Closed Bug 1312104 Opened 6 years ago Closed 6 years ago

minor cleanups in indexedDB Key code

Categories

(Core :: Storage: IndexedDB, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(2 files)

We have better ways of writing some of the floating-point serialization bits.
We have code elsewhere for this sort of stuff; let's use it here.
Attachment #8803510 - Flags: review?(jvarga)
This way is a little bit more readable.
Attachment #8803511 - Flags: review?(jvarga)
Comment on attachment 8803510 [details] [diff] [review]
part 1 - use BitwiseCast for punning between uint64_t/double in indexedDB

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

Looks good.

btw, there's one more "pun" in dom/indexedDB/ActorsParent.cpp, DatabaseOperationBase::ReinterpretDoubleAsUInt64()
Attachment #8803510 - Flags: review?(jvarga) → review+
Comment on attachment 8803511 [details] [diff] [review]
part 2 - use FloatingPoint<>::kSignBit in lieu of hand-rolled constant

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

::: dom/indexedDB/Key.cpp
@@ +616,2 @@
>                      (0 - bits) :
> +                    (bits | signbit);

Nit: merge into one line ?

@@ +642,1 @@
>                    (0 - number);

dtto
Attachment #8803511 - Flags: review?(jvarga) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/22876ba02fee
part 1 - use BitwiseCast for punning between uint64_t/double in indexedDB; r=janv
https://hg.mozilla.org/integration/mozilla-inbound/rev/9c10b3a0b1e2
part 2 - use FloatingPoint<>::kSignBit in lieu of hand-rolled constant; r=janv
https://hg.mozilla.org/mozilla-central/rev/22876ba02fee
https://hg.mozilla.org/mozilla-central/rev/9c10b3a0b1e2
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.