Implements ConstString in several core places in the library, improving performance.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-02-27 18:23:23 +01:00
parent 1d3a8da99e
commit 412e0a4d63
17 changed files with 161 additions and 148 deletions

View File

@@ -5,10 +5,10 @@ CreatureLib::Library::AttackData::AttackData(std::string name, uint8_t type,
CreatureLib::Library::AttackCategory category, uint8_t power,
uint8_t accuracy, uint8_t baseUsage,
CreatureLib::Library::AttackTarget target, int8_t priority,
std::unordered_set<std::string> flags)
std::unordered_set<Arbutils::CaseInsensitiveConstString> flags)
: _name(std::move(name)), _type(type), _category(category), _basePower(power), _accuracy(accuracy),
_baseUsages(baseUsage), _target(target), _priority(priority), _flags(std::move(flags)) {}
bool CreatureLib::Library::AttackData::HasFlag(const std::string& key) const {
bool CreatureLib::Library::AttackData::HasFlag(const Arbutils::CaseInsensitiveConstString& key) const {
return this->_flags.find(key) != this->_flags.end();
}