use same hash code whether readOnly or not
This commit is contained in:
parent
badee1ffe1
commit
165dfa2b70
|
@ -175,7 +175,7 @@ ATNConfigSet.prototype.equals = function(other) {
|
||||||
|
|
||||||
ATNConfigSet.prototype.hashCode = function() {
|
ATNConfigSet.prototype.hashCode = function() {
|
||||||
var hash = new Hash();
|
var hash = new Hash();
|
||||||
this.updateHashCode(hash);
|
hash.update(this.configs);
|
||||||
return hash.finish();
|
return hash.finish();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -183,13 +183,11 @@ ATNConfigSet.prototype.hashCode = function() {
|
||||||
ATNConfigSet.prototype.updateHashCode = function(hash) {
|
ATNConfigSet.prototype.updateHashCode = function(hash) {
|
||||||
if (this.readOnly) {
|
if (this.readOnly) {
|
||||||
if (this.cachedHashCode === -1) {
|
if (this.cachedHashCode === -1) {
|
||||||
var hash = new Hash();
|
this.cachedHashCode = this.hashCode();
|
||||||
hash.update(this.configs);
|
|
||||||
this.cachedHashCode = hash.finish();
|
|
||||||
}
|
}
|
||||||
hash.update(this.cachedHashCode);
|
hash.update(this.cachedHashCode);
|
||||||
} else {
|
} else {
|
||||||
hash.update(this.configs);
|
hash.update(this.hashCode());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue