Speed up plugin condition evaluation

Avoid unnecessary CRC calculation while evaluating conditions.
This commit is contained in:
Oliver Hamlet
2015-11-26 19:19:29 +00:00
parent 547106bc55
commit d0d592a35b
+6 -6
View File
@@ -296,8 +296,12 @@ namespace loot {
++it;
}
//First need to get plugin's CRC, if it is an exact plugin and it does not have its CRC set.
if (!IsRegexPlugin()) {
// Regex plugins shouldn't have dirty info, but just clear in case.
if (IsRegexPlugin())
_dirtyInfo.clear();
if (!_dirtyInfo.empty()) {
//First need to get plugin's CRC, if it is an exact plugin and it does not have its CRC set.
uint32_t crc = game.GetCachedCrc(name);
if (crc == 0) {
if (boost::filesystem::exists(game.DataPath() / name)) {
@@ -324,10 +328,6 @@ namespace loot {
++it;
}
}
else {
// Regex plugins shouldn't have dirty info, but just clear in case.
_dirtyInfo.clear();
}
return *this;
}