forked from jaildesigner-jailgames/jaildoctors_dilemma
clang-format
clang-tidy (macos)
This commit is contained in:
@@ -3,17 +3,17 @@
|
||||
#include <algorithm> // Para std::ranges::any_of
|
||||
|
||||
// Comprueba si la habitación ya ha sido visitada
|
||||
auto RoomTracker::hasBeenVisited(const std::string& name) -> bool {
|
||||
return std::ranges::any_of(rooms_, [&name](const auto& l) { return l == name; });
|
||||
auto RoomTracker::hasBeenVisited(const std::string& name) -> bool { // NOLINT(readability-convert-member-functions-to-static)
|
||||
return std::ranges::any_of(rooms_, [&name](const auto& l) -> bool { return l == name; });
|
||||
}
|
||||
|
||||
// Añade la habitación a la lista
|
||||
auto RoomTracker::addRoom(const std::string& name) -> bool {
|
||||
auto RoomTracker::addRoom(const std::string& name) -> bool { // NOLINT(readability-convert-member-functions-to-static)
|
||||
// Comprueba si la habitación ya ha sido visitada
|
||||
if (!hasBeenVisited(name)) {
|
||||
// En caso contrario añádela a la lista
|
||||
rooms_.push_back(name);
|
||||
return true;
|
||||
return true; // NOLINT(readability-simplify-boolean-expr)
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user