Skip to content

Commit

Permalink
don't realloc PriorityQHeap's handle list
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankenny committed Oct 29, 2015
1 parent 17e9238 commit cd52027
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 36 deletions.
5 changes: 1 addition & 4 deletions libtess.cat.js
Original file line number Diff line number Diff line change
Expand Up @@ -4590,8 +4590,7 @@ libtess.PriorityQHeap = function(leq) {
* Empty slots below size_ are a free list chain starting at freeList_.
* @private {!Array<number>}
*/
this.handles_ = libtess.PriorityQHeap.reallocNumeric_([0],
libtess.PriorityQHeap.INIT_SIZE_ + 1);
this.handles_ = [0, 0];

/**
* The size of the queue.
Expand Down Expand Up @@ -4692,8 +4691,6 @@ libtess.PriorityQHeap.prototype.insert = function(keyNew) {
if ((endIndex * 2) > this.max_) {
this.max_ *= 2;

this.heap_ = libtess.PriorityQHeap.reallocNumeric_(this.heap_,
this.max_ + 1);
this.handles_ = libtess.PriorityQHeap.reallocNumeric_(this.handles_,
this.max_ + 1);
}
Expand Down
5 changes: 1 addition & 4 deletions libtess.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -4660,8 +4660,7 @@ libtess.PriorityQHeap = function(leq) {
* Empty slots below size_ are a free list chain starting at freeList_.
* @private {!Array<number>}
*/
this.handles_ = libtess.PriorityQHeap.reallocNumeric_([0],
libtess.PriorityQHeap.INIT_SIZE_ + 1);
this.handles_ = [0, 0];

/**
* The size of the queue.
Expand Down Expand Up @@ -4762,8 +4761,6 @@ libtess.PriorityQHeap.prototype.insert = function(keyNew) {
if ((endIndex * 2) > this.max_) {
this.max_ *= 2;

this.heap_ = libtess.PriorityQHeap.reallocNumeric_(this.heap_,
this.max_ + 1);
this.handles_ = libtess.PriorityQHeap.reallocNumeric_(this.handles_,
this.max_ + 1);
}
Expand Down
Loading

0 comments on commit cd52027

Please sign in to comment.