Commit cd807705 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[FragmentItem] Use |NGInlineCursorPosition| in |MoveToLastForSameLayoutObject|

|MoveToLastForSameLayoutObject| saves |NGInlineCursor|
because it was written before |NGInlineCursorPosition| was
added. This patch changes to save |NGInlineCursorPosition|,
saving a bit of memory bandwidth.

This patch has no behavior changes.

Bug: 982194
Change-Id: Ia1b8ddbf303c2823b2f72e8f24883435602d8399
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2120372Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753503}
parent c78f203a
...@@ -1076,12 +1076,14 @@ void NGInlineCursor::MoveToLastChild() { ...@@ -1076,12 +1076,14 @@ void NGInlineCursor::MoveToLastChild() {
} }
void NGInlineCursor::MoveToLastForSameLayoutObject() { void NGInlineCursor::MoveToLastForSameLayoutObject() {
NGInlineCursor last; if (!Current())
while (IsNotNull()) { return;
last = *this; NGInlineCursorPosition last;
do {
last = Current();
MoveToNextForSameLayoutObject(); MoveToNextForSameLayoutObject();
} } while (Current());
*this = last; MoveTo(last);
} }
void NGInlineCursor::MoveToLastLogicalLeaf() { void NGInlineCursor::MoveToLastLogicalLeaf() {
......
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