Bug 1706894: part 3) Change MapDOMPositionToSoftTextOffset's argument to const reference. r=smaug

More efficient.

Depends on D113080

Differential Revision: https://phabricator.services.mozilla.com/D113081
This commit is contained in:
Mirko Brodesser 2021-04-22 13:35:39 +00:00
parent 25f87040f2
commit df29e1a8f4
2 changed files with 2 additions and 2 deletions

View File

@ -947,7 +947,7 @@ auto mozInlineSpellWordUtil::BuildRealWords() const
* ************/
int32_t mozInlineSpellWordUtil::MapDOMPositionToSoftTextOffset(
NodeOffset aNodeOffset) const {
const NodeOffset& aNodeOffset) const {
if (!mSoftText.mIsValid) {
NS_ERROR("Soft text must be valid if we're to map into it");
return -1;

View File

@ -206,7 +206,7 @@ class MOZ_STACK_CLASS mozInlineSpellWordUtil {
nsresult EnsureWords(NodeOffset aSoftBegin, NodeOffset aSoftEnd);
int32_t MapDOMPositionToSoftTextOffset(NodeOffset aNodeOffset) const;
int32_t MapDOMPositionToSoftTextOffset(const NodeOffset& aNodeOffset) const;
// Map an offset into mSoftText.mValue to a DOM position. Note that two DOM
// positions can map to the same mSoftText.mValue offset, e.g. given nodes
// A=aaaa and B=bbbb forming aaaabbbb, (A,4) and (B,0) give the same string