mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
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:
parent
25f87040f2
commit
df29e1a8f4
@ -947,7 +947,7 @@ auto mozInlineSpellWordUtil::BuildRealWords() const
|
|||||||
* ************/
|
* ************/
|
||||||
|
|
||||||
int32_t mozInlineSpellWordUtil::MapDOMPositionToSoftTextOffset(
|
int32_t mozInlineSpellWordUtil::MapDOMPositionToSoftTextOffset(
|
||||||
NodeOffset aNodeOffset) const {
|
const NodeOffset& aNodeOffset) const {
|
||||||
if (!mSoftText.mIsValid) {
|
if (!mSoftText.mIsValid) {
|
||||||
NS_ERROR("Soft text must be valid if we're to map into it");
|
NS_ERROR("Soft text must be valid if we're to map into it");
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -206,7 +206,7 @@ class MOZ_STACK_CLASS mozInlineSpellWordUtil {
|
|||||||
|
|
||||||
nsresult EnsureWords(NodeOffset aSoftBegin, NodeOffset aSoftEnd);
|
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
|
// 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
|
// 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
|
// A=aaaa and B=bbbb forming aaaabbbb, (A,4) and (B,0) give the same string
|
||||||
|
Loading…
Reference in New Issue
Block a user