neteja clang-tidy: enums uint8_t, includes, naming i altres
This commit is contained in:
@@ -19,19 +19,19 @@ namespace Difficulty {
|
||||
}
|
||||
|
||||
auto getNameFromCode(Code code) -> std::string {
|
||||
const auto it = std::ranges::find_if(difficulties_list,
|
||||
const auto IT = std::ranges::find_if(difficulties_list,
|
||||
[code](const auto& difficulty) { return difficulty.code == code; });
|
||||
if (it != difficulties_list.end()) {
|
||||
return it->name;
|
||||
if (IT != difficulties_list.end()) {
|
||||
return IT->name;
|
||||
}
|
||||
return !difficulties_list.empty() ? difficulties_list.front().name : "Unknown";
|
||||
}
|
||||
|
||||
auto getCodeFromName(const std::string& name) -> Code {
|
||||
const auto it = std::ranges::find_if(difficulties_list,
|
||||
const auto IT = std::ranges::find_if(difficulties_list,
|
||||
[&name](const auto& difficulty) { return difficulty.name == name; });
|
||||
if (it != difficulties_list.end()) {
|
||||
return it->code;
|
||||
if (IT != difficulties_list.end()) {
|
||||
return IT->code;
|
||||
}
|
||||
return !difficulties_list.empty() ? difficulties_list.front().code : Code::NORMAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user