clang-tidy readability

This commit is contained in:
2025-07-20 14:56:00 +02:00
parent f5245273a1
commit ca99f7be34
57 changed files with 623 additions and 557 deletions

View File

@@ -300,18 +300,15 @@ void applyPendingChanges() {
}
void checkPendingChanges() {
if (settings.language != pending_changes.new_language ||
settings.difficulty != pending_changes.new_difficulty) {
pending_changes.has_pending_changes = true;
} else {
pending_changes.has_pending_changes = false;
}
pending_changes.has_pending_changes = settings.language != pending_changes.new_language ||
settings.difficulty != pending_changes.new_difficulty;
}
auto getDifficultyCodeFromName(const std::string &name) -> DifficultyCode {
for (const auto &difficulty : difficulties) {
if (difficulty.name == name)
if (difficulty.name == name) {
return difficulty.code;
}
}
// Si no se encuentra, devuelve el primero por defecto
return difficulties[0].code;
@@ -319,8 +316,9 @@ auto getDifficultyCodeFromName(const std::string &name) -> DifficultyCode {
auto getDifficultyNameFromCode(DifficultyCode code) -> std::string {
for (const auto &difficulty : difficulties) {
if (difficulty.code == code)
if (difficulty.code == code) {
return difficulty.name;
}
}
// Si no se encuentra, devuelve el nombre del primero por defecto
return difficulties[0].name;