Closed Bug 1653485 Opened 4 years ago Closed 4 years ago

Avoid unnecessary copy of stack only classes

Categories

(Core :: DOM: Editor, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(3 files)

In WSRunObject.cpp, TextFragmentData is copied even when it's safe to refer with const-reference. We should stop it.

Severity: -- → S3
Priority: -- → P2

They return copy of cached EditorDOMRange instance. So, they can return
const-reference rather than copy of stored data.

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/9dfd625107a4
part 1: Make `TextFragmentData::GetInvisibleLeadingWhiteSpaceRange()` and `TextFragmentData::GetInvisibleTrailingWhiteSpaceRange()` return const-reference r=m_kato
https://hg.mozilla.org/integration/autoland/rev/e1b6c060290a
part 2: Change each lvalue which is initialized with result of `*Ref()` methods in `WSRunObject.cpp` to `const Foo&` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/78186a074f2f
part 3: Rename `WSRunScanner::TextFragmentDataAtStart()` to `WSRunScanner::TextFragmentDataAtStartRef()` r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
No longer regressions: 1654585
Regressions: 1655434
No longer regressions: 1655434
Regressions: 1654585
No longer regressions: 1654585
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: