Commit 75a65190 authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Commit Bot

Use EnsureMutableInvalidationSet in RuleFeatureSet::AddInvalidationSet

Rather than calling EnsureInvalidationSet() and performing another
lookup in |map|, just use the |slot| that we already have and call
EnsureMutableInvalidationSet().
Also change to move the invalidation set into |slot| if it is empty.

Change-Id: Ibefdf3ac7ef13fd3b7e05e4086405a0b980603f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2289838
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786838}
parent 9969734a
......@@ -321,10 +321,10 @@ void RuleFeatureSet::AddInvalidationSet(
scoped_refptr<InvalidationSet>& slot =
map.insert(key, nullptr).stored_value->value;
if (!slot) {
slot = invalidation_set;
slot = std::move(invalidation_set);
} else {
EnsureInvalidationSet(
map, key, invalidation_set->GetType(),
EnsureMutableInvalidationSet(
slot, invalidation_set->GetType(),
invalidation_set->IsSelfInvalidationSet() ? kSubject : kAncestor)
.Combine(*invalidation_set);
}
......@@ -338,10 +338,10 @@ void RuleFeatureSet::AddInvalidationSet(
scoped_refptr<InvalidationSet>& slot =
map.insert(key, nullptr).stored_value->value;
if (!slot) {
slot = invalidation_set;
slot = std::move(invalidation_set);
} else {
EnsureInvalidationSet(
map, key, invalidation_set->GetType(),
EnsureMutableInvalidationSet(
slot, invalidation_set->GetType(),
invalidation_set->IsSelfInvalidationSet() ? kSubject : kAncestor)
.Combine(*invalidation_set);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment