Remove use of goog.object.containsKey

This commit is contained in:
Frederic Junod
2015-11-24 10:12:13 +01:00
parent 90e224bd96
commit 8d72589743
6 changed files with 13 additions and 17 deletions

View File

@@ -59,8 +59,7 @@ ol.structs.RBush.prototype.insert = function(extent, value) {
];
this.rbush_.insert(item);
// remember the object that was added to the internal rbush
goog.asserts.assert(
!goog.object.containsKey(this.items_, goog.getUid(value)),
goog.asserts.assert(!(goog.getUid(value) in this.items_),
'uid (%s) of value (%s) already exists', goog.getUid(value), value);
this.items_[goog.getUid(value)] = item;
};
@@ -92,8 +91,7 @@ ol.structs.RBush.prototype.load = function(extents, values) {
value
];
items[i] = item;
goog.asserts.assert(
!goog.object.containsKey(this.items_, goog.getUid(value)),
goog.asserts.assert(!(goog.getUid(value) in this.items_),
'uid (%s) of value (%s) already exists', goog.getUid(value), value);
this.items_[goog.getUid(value)] = item;
}
@@ -111,7 +109,7 @@ ol.structs.RBush.prototype.remove = function(value) {
throw new Error('Can not remove value while reading');
}
var uid = goog.getUid(value);
goog.asserts.assert(goog.object.containsKey(this.items_, uid),
goog.asserts.assert(uid in this.items_,
'uid (%s) of value (%s) does not exist', uid, value);
// get the object in which the value was wrapped when adding to the
@@ -129,7 +127,7 @@ ol.structs.RBush.prototype.remove = function(value) {
*/
ol.structs.RBush.prototype.update = function(extent, value) {
var uid = goog.getUid(value);
goog.asserts.assert(goog.object.containsKey(this.items_, uid),
goog.asserts.assert(uid in this.items_,
'uid (%s) of value (%s) does not exist', uid, value);
var item = this.items_[uid];