perf: aplicar checks performance-* (91 fixes)

Cambios aplicados:
- Reemplazar std::endl con '\n' (91 casos)
  * std::endl hace flush del buffer (más lento)
  * '\n' solo inserta newline (más rápido)
  * Mejora rendimiento de logging/debug

Check excluido:
- performance-enum-size: Tamaño de enum no es crítico para rendimiento
This commit is contained in:
2025-12-18 21:24:07 +01:00
parent 7f6af6dd00
commit 364cf36183
17 changed files with 94 additions and 92 deletions

View File

@@ -40,7 +40,7 @@ EscenaJoc::EscenaJoc(SDLManager& sdl, ContextEscenes& context)
<< (config_partida_.jugador1_actiu ? "ACTIU" : "INACTIU")
<< ", P2: "
<< (config_partida_.jugador2_actiu ? "ACTIU" : "INACTIU")
<< std::endl;
<< '\n';
// Consumir opcions (preparació per MODE_DEMO futur)
auto opcio = context_.consumir_opcio();
@@ -133,7 +133,7 @@ void EscenaJoc::inicialitzar() {
if (!stage_config_) {
stage_config_ = StageSystem::StageLoader::carregar("data/stages/stages.yaml");
if (!stage_config_) {
std::cerr << "[EscenaJoc] Error: no s'ha pogut carregar stages.yaml" << std::endl;
std::cerr << "[EscenaJoc] Error: no s'ha pogut carregar stages.yaml" << '\n';
// Continue without stage system (will crash, but helps debugging)
}
}
@@ -414,7 +414,7 @@ void EscenaJoc::actualitzar(float delta_time) {
// [DEBUG] Log entrada a LEVEL_START
static bool first_entry = true;
if (first_entry) {
std::cout << "[LEVEL_START] ENTERED with P1 pos.y=" << naus_[0].get_centre().y << std::endl;
std::cout << "[LEVEL_START] ENTERED with P1 pos.y=" << naus_[0].get_centre().y << '\n';
first_entry = false;
}
@@ -1442,5 +1442,5 @@ void EscenaJoc::unir_jugador(uint8_t player_id) {
// No visual message, just spawn (per user requirement)
std::cout << "[EscenaJoc] Jugador " << (int)(player_id + 1) << " s'ha unit a la partida!" << std::endl;
std::cout << "[EscenaJoc] Jugador " << (int)(player_id + 1) << " s'ha unit a la partida!" << '\n';
}