aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjulien.hamaide <julien.hamaide@fishingcactus.com>2012-02-09 09:35:06 +0100
committerjulien.hamaide <julien.hamaide@fishingcactus.com>2012-02-09 09:35:06 +0100
commit60be52255a30b28ab956b17998b52d8985dc30d7 (patch)
tree7ff760802d4494f7029153e094cfe7eda707da9c
parent05ee87ee865ece5edef2e535addd909baa74017e (diff)
Fix error found by ehsan in GL.hastable
-rw-r--r--src/library_gl.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 389d8d5b..a10b9384 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -11,14 +11,13 @@ var LibraryGL = {
if (!(name in this._hashtables)) {
this._hashtables[name] = {
table: {},
- counter: 0,
+ counter: 1,
add: function(obj) {
var id = this.counter++;
this.table[id] = obj;
return id;
},
get: function(id) {
-
if( id == 0 ) return null;
#if ASSERTIONS
assert(id < this.counter, "Invalid id " + id + " for the hashtable " + name);
@@ -26,6 +25,7 @@ var LibraryGL = {
return this.table[id];
},
remove: function(id) {
+ if( id == 0 ) return;
#if ASSERTIONS
assert(id < this.counter, "Invalid id " + id + " for the hashtable " + name);
#endif