perf.肉鸽选人一处小细节优化

This commit is contained in:
MistEO
2022-04-03 20:40:40 +08:00
parent c5a7db0751
commit 2f306b8e44

View File

@@ -51,8 +51,9 @@ bool asst::RoguelikeRecruitTaskPlugin::_run()
Log.info("visible opers count", analyzer.get_result().size(), "visible opers", visible_opers);
}
// demand_filter
std::unordered_set<std::string> opers_set(m_opers.cbegin(), m_opers.cend());
analyzer.filter([&](const TextRect& x) -> bool {
return find(m_opers.begin(), m_opers.end(), x.text) != m_opers.end();
return opers_set.find(x.text) != opers_set.cend();
}
);