Don't check for under-full nodes when validating ol.structs.RBush
Removal can lead to under-full nodes.
This commit is contained in:
@@ -94,25 +94,21 @@ ol.structs.RBushNode.compareMinY = function(node1, node2) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {boolean} isRoot Is root.
|
|
||||||
* @param {number} minEntries Min entries.
|
|
||||||
* @param {number} maxEntries Max entries.
|
* @param {number} maxEntries Max entries.
|
||||||
*/
|
*/
|
||||||
ol.structs.RBushNode.prototype.assertValid =
|
ol.structs.RBushNode.prototype.assertValid = function(maxEntries) {
|
||||||
function(isRoot, minEntries, maxEntries) {
|
|
||||||
if (this.height === 0) {
|
if (this.height === 0) {
|
||||||
goog.asserts.assert(goog.isNull(this.children));
|
goog.asserts.assert(goog.isNull(this.children));
|
||||||
goog.asserts.assert(!goog.isNull(this.value));
|
goog.asserts.assert(!goog.isNull(this.value));
|
||||||
} else {
|
} else {
|
||||||
goog.asserts.assert(!goog.isNull(this.children));
|
goog.asserts.assert(!goog.isNull(this.children));
|
||||||
goog.asserts.assert(goog.isNull(this.value));
|
goog.asserts.assert(goog.isNull(this.value));
|
||||||
goog.asserts.assert(isRoot || minEntries <= this.children.length);
|
|
||||||
goog.asserts.assert(this.children.length <= maxEntries);
|
goog.asserts.assert(this.children.length <= maxEntries);
|
||||||
var i, ii;
|
var i, ii;
|
||||||
for (i = 0, ii = this.children.length; i < ii; ++i) {
|
for (i = 0, ii = this.children.length; i < ii; ++i) {
|
||||||
var child = this.children[i];
|
var child = this.children[i];
|
||||||
goog.asserts.assert(ol.extent.containsExtent(this.extent, child.extent));
|
goog.asserts.assert(ol.extent.containsExtent(this.extent, child.extent));
|
||||||
child.assertValid(false, minEntries, maxEntries);
|
child.assertValid(maxEntries);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -262,7 +258,7 @@ ol.structs.RBush.prototype.allInExtent = function(extent) {
|
|||||||
* FIXME empty description for jsdoc
|
* FIXME empty description for jsdoc
|
||||||
*/
|
*/
|
||||||
ol.structs.RBush.prototype.assertValid = function() {
|
ol.structs.RBush.prototype.assertValid = function() {
|
||||||
this.root_.assertValid(true, this.minEntries_, this.maxEntries_);
|
this.root_.assertValid(this.maxEntries_);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user