summaryrefslogtreecommitdiff
path: root/src/lobject.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lobject.js')
-rw-r--r--src/lobject.js25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/lobject.js b/src/lobject.js
index 385ac9c..e206bf1 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -163,31 +163,6 @@ class Table extends TValue {
return this.luaH_getn();
}
- /*
- ** Try to find a boundary in table 't'. A 'boundary' is an integer index
- ** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil).
- */
- luaH_getn() {
- let array = this.value.array;
- let hash = this.value.hash;
-
- let j = array.length;
- if (j > 0 && array[j - 1].ttisnil()) {
- /* there is a boundary in the array part: (binary) search for it */
- let i = 0;
- while (j - i > 1) {
- let m = (i+j)/2;
- if (array[m - 1].ttisnil()) j = m;
- else i = m;
- }
- return i;
- }
- /* else must find a boundary in hash part */
- else if (hash.size === 0)
- return j;
- else return j; // TODO: unbound_search(t, j) => but why ?
- }
-
}
class LClosure extends TValue {