Closed Bug 1715532 Opened 4 years ago Closed 4 years ago

Remove some unnecessary const_cast and static_cast

Categories

(Core :: JavaScript Engine, task)

task

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

No description provided.

js/src/frontend/Stencil.cpp:
codeStencil() was previously accepting a non-const reference, but has since
then been updated to accept a const reference. Therefore we no longer need the
const_cast.

js/src/gc/Zone.cpp:
r.front().key() returns a non-const pointer, so the const_cast is a no-op.

js/src/jit/WarpSnapshot.h:
The code was probably copied from CompilerGCPointer, but for WarpGCPtr we
don't need the static_cast.

js/src/vm/NativeObject.h and js/src/vm/GeneratorObject.cpp:
Make NativeObject::getDenseElements() a const method, so we don't need the
const_cast.

Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/08ef5d2e2a7a Remove some unnecessary const_cast and static_cast. r=jonco
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: