Micro-optimizations to Style

This commit is contained in:
Bruno de Oliveira Abinader
2015-07-12 14:09:49 +03:00
parent 938165de17
commit 77a91f64d8

View File

@@ -273,18 +273,11 @@ bool StyleLayer::hasTransitions() const {
void StyleLayer::cleanupAppliedStyleProperties(TimePoint now) {
auto it = appliedStyle.begin();
const auto end = appliedStyle.end();
while (it != end) {
AppliedClassProperties &applied_properties = it->second;
applied_properties.cleanup(now);
for (auto it = appliedStyle.begin(); it != appliedStyle.end();) {
AppliedClassProperties& appliedPropertyValues = it->second;
appliedPropertyValues.cleanup(now);
// If the current properties object is empty, remove it from the map entirely.
if (applied_properties.empty()) {
appliedStyle.erase(it++);
} else {
++it;
}
appliedPropertyValues.empty() ? appliedStyle.erase(it++) : ++it;
}
}