зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1599465 - Part 9: Add 'const' modifier to hash() and dump() methods. r=jwalden
An earlier part changed the `digit` function to be `const`, so we can now make these two functions `const`, too. Differential Revision: https://phabricator.services.mozilla.com/D54765 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
c206352de3
Коммит
28319c9e07
|
@ -183,7 +183,7 @@ void BigInt::finalize(JSFreeOp* fop) {
|
|||
}
|
||||
}
|
||||
|
||||
js::HashNumber BigInt::hash() {
|
||||
js::HashNumber BigInt::hash() const {
|
||||
js::HashNumber h =
|
||||
mozilla::HashBytes(digits().data(), digitLength() * sizeof(Digit));
|
||||
return mozilla::AddToHash(h, isNegative());
|
||||
|
@ -3511,12 +3511,12 @@ template JSAtom* js::BigIntToAtom<js::CanGC>(JSContext* cx, HandleBigInt bi);
|
|||
template JSAtom* js::BigIntToAtom<js::NoGC>(JSContext* cx, HandleBigInt bi);
|
||||
|
||||
#if defined(DEBUG) || defined(JS_JITSPEW)
|
||||
void BigInt::dump() {
|
||||
void BigInt::dump() const {
|
||||
js::Fprinter out(stderr);
|
||||
dump(out);
|
||||
}
|
||||
|
||||
void BigInt::dump(js::GenericPrinter& out) {
|
||||
void BigInt::dump(js::GenericPrinter& out) const {
|
||||
if (isNegative()) {
|
||||
out.putChar('-');
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ class BigInt final
|
|||
|
||||
void traceChildren(JSTracer* trc);
|
||||
void finalize(JSFreeOp* fop);
|
||||
js::HashNumber hash();
|
||||
js::HashNumber hash() const;
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
|
||||
|
||||
static BigInt* createUninitialized(JSContext* cx, size_t digitLength,
|
||||
|
@ -218,8 +218,8 @@ class BigInt final
|
|||
mozilla::Maybe<bool>& res);
|
||||
|
||||
#if defined(DEBUG) || defined(JS_JITSPEW)
|
||||
void dump(); // Debugger-friendly stderr dump.
|
||||
void dump(js::GenericPrinter& out);
|
||||
void dump() const; // Debugger-friendly stderr dump.
|
||||
void dump(js::GenericPrinter& out) const;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
|
Загрузка…
Ссылка в новой задаче