Skip to content

Commit

Permalink
start object ids at one
Browse files Browse the repository at this point in the history
  • Loading branch information
biasmv committed Mar 22, 2015
1 parent de4e2f2 commit cadf280
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tests/unique-object-id-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ require(['unique-object-id-pool'], function(UniqueObjectIdPool) {
test("simple continuous range", function(assert) {
var idPool = new UniqueObjectIdPool();
var range = idPool.getContinuousRange(5);
assert.strictEqual(range.nextId({}), 0);
assert.strictEqual(range.nextId({}), 1);
assert.strictEqual(range.nextId({}), 2);
assert.strictEqual(range.nextId({}), 3);
assert.strictEqual(range.nextId({}), 4);
assert.strictEqual(range.nextId({}), 5);
assert.strictEqual(range.length(), 5);
range.recycle();
});
Expand Down
2 changes: 1 addition & 1 deletion src/unique-object-id-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ UniqueObjectIdPool.prototype = {
},
clear : function() {
this._objects = {};
this._unusedRangeStart = 0;
this._unusedRangeStart = 1;
this._free = [];
this._usedCount = 0;
},
Expand Down

0 comments on commit cadf280

Please sign in to comment.