Commit f4f8701e authored by Hajime Hoshi's avatar Hajime Hoshi Committed by Commit Bot

BackForwardCache: Refactoring: Use back() instead of an index

Bug: 1014174
Change-Id: I27fc6bcfb0a0bfa2937f9ad26a1bdc2e984dd803
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2251858
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Reviewed-by: default avatarNicolás Peña Moreno <npm@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780242}
parent 44abaa66
......@@ -289,11 +289,9 @@ void PaintTiming::SetFirstPaintAfterBackForwardCacheRestoreSwap(
base::TimeTicks stamp) {
// The last element is already allocated when the page is restored from the
// cache.
size_t last_index =
first_paints_after_back_forward_cache_restore_swap_.size() - 1;
DCHECK(first_paints_after_back_forward_cache_restore_swap_[last_index]
.is_null());
first_paints_after_back_forward_cache_restore_swap_[last_index] = stamp;
DCHECK(!first_paints_after_back_forward_cache_restore_swap_.IsEmpty());
DCHECK(first_paints_after_back_forward_cache_restore_swap_.back().is_null());
first_paints_after_back_forward_cache_restore_swap_.back() = stamp;
NotifyPaintTimingChanged();
}
......
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