Closed Bug 1496863 Opened Last year Closed Last year

Various UTF-8-to-UTF-16 inflation mini-fixes

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: Waldo, Assigned: Waldo)

Details

Attachments

(3 files)

Noticed these while looking at the changes bug 1495571 made.
Attachment #9014974 - Flags: review?(arai.unmht)
Comment on attachment 9014972 [details] [diff] [review]
Add a constexpr char16_t unicode::REPLACEMENT_CHARACTER, and change the two (!) separate const char16_t variables of the same value in CharacterEncoding.cpp with it

Review of attachment 9014972 [details] [diff] [review]:
-----------------------------------------------------------------

(stealing)
Attachment #9014972 - Flags: review?(arai.unmht) → review+
Comment on attachment 9014973 [details] [diff] [review]
Use precise capture-lists for the various lambdas in CharacterEncoding.cpp, rather than using [&] and capturing everything willy-nilly by reference

Review of attachment 9014973 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/vm/CharacterEncoding.cpp
@@ +420,4 @@
>              ? OnUTF8Error::InsertQuestionMark
>              : OnUTF8Error::InsertReplacementCharacter;
>          size_t j = 0;
> +        auto push = [dst, &j](char16_t c) -> LoopDisposition {

No &dst? Doesn't this mean copy?
Attachment #9014974 - Flags: review?(arai.unmht) → review+
Comment on attachment 9014973 [details] [diff] [review]
Use precise capture-lists for the various lambdas in CharacterEncoding.cpp, rather than using [&] and capturing everything willy-nilly by reference

Review of attachment 9014973 [details] [diff] [review]:
-----------------------------------------------------------------

Oh dst is a pointer obviously.
Attachment #9014973 - Flags: review?(arai.unmht) → review+
Priority: -- → P2
Pushed by jwalden@mit.edu:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ed81d578d775
Add a constexpr char16_t unicode::REPLACEMENT_CHARACTER, and change the two (!) separate const char16_t variables of the same value in CharacterEncoding.cpp with it.  r=evilpie
https://hg.mozilla.org/integration/mozilla-inbound/rev/da12058b40be
Use precise capture-lists for the various lambdas in CharacterEncoding.cpp, rather than using [&] and capturing everything willy-nilly by reference.  r=evilpie
https://hg.mozilla.org/integration/mozilla-inbound/rev/d912f4d60ea4
Remove an obsolete comment.  r=evilpie
You need to log in before you can comment on or make changes to this bug.