Closed
Bug 1749440
Opened 3 years ago
Closed 3 years ago
Add a Insert method taking a mozilla::Span parameter for nsTSubstring
Categories
(Core :: XPCOM, task)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
98 Branch
| Tracking | Status | |
|---|---|---|
| firefox98 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
Attachments
(1 file)
nsTSubstring::Append can take mozilla::Span argument [1]. It would be nice to have Insert taking mozilla::Span as well.
For example: to insert a span at the beginning of a string, we can use [2] on currently m-c and write
Span s(...)
nsString str(...)
str.insert(s.Elements(), 0, s.Length());
However, it's more convenient to have insert accept Span, similar to the one taking a string [3].
Span s(...)
nsString str(...)
str.insert(s, 0);
[1] https://searchfox.org/mozilla-central/rev/618f9970972adc5a21194d39d690ec0865f26024/xpcom/string/nsTSubstring.h#946-962
[2] https://searchfox.org/mozilla-central/rev/618f9970972adc5a21194d39d690ec0865f26024/xpcom/string/nsTSubstring.h#727-730
[3] https://searchfox.org/mozilla-central/rev/618f9970972adc5a21194d39d690ec0865f26024/xpcom/string/nsTSubstring.h#738-740
| Assignee | ||
Comment 1•3 years ago
|
||
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/066e981f1e8e
Add nsTSubstring::Insert() that takes a mozilla::Span parameter. r=xpcom-reviewers,nika
Comment 3•3 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 3 years ago
status-firefox98:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•