fix: 地图名查找

This commit is contained in:
status102
2026-03-16 21:01:39 +08:00
parent 6349d68f8c
commit f7ae271a2b
2 changed files with 4 additions and 4 deletions

View File

@@ -23,10 +23,10 @@ struct LevelKey
}
matched = true;
}
return true;
return true; // ignore this property if rhs is empty
}
bool operator==(const LevelKey& other) const noexcept
bool match(const LevelKey& other) const noexcept
{
bool has_non_empty_match = false;
return check_and_track(stageId, other.stageId, has_non_empty_match) &&
@@ -35,7 +35,7 @@ struct LevelKey
check_and_track(name, other.name, has_non_empty_match) && has_non_empty_match;
}
bool operator==(const std::string& any_key) const noexcept
bool match(const std::string& any_key) const noexcept
{
if (any_key.empty()) {
return false;

View File

@@ -71,7 +71,7 @@ public:
std::optional<LazyMap::value_type> find(const KeyT& key) const
{
for (const auto& pair : m_summarize) {
if (pair.first == key) {
if (pair.first.match(key)) {
return pair;
}
}