on master help sign in
Fix getSlot
commita05e57660fe590028994be17ba0f32ef1bf123fa authorChristian Widera <xash@posteo.de> dateWed 23 Apr 2014, 12:40 (13 years ago) parent49b4ca8
1 file changed+2−4
libraries/Native/Array.js+2−4
libraries/Native/Array.js+2−4
@@ -539,10 +539,8 @@ Elm.Native.Array.make = function(elm) {
539539 // Calculates in which slot of "table" the item probably is, then
540540 // find the exact slot via forward searching in "lengths". Returns the index.
541541 function getSlot(i, a) {
542− var slot = i << (5 * a.height);
543− while (a.lengths[slot - 1] > i) {
544− slot++;
545− }
542+ var slot = i >> (5 * a.height);
543+ while (a.lengths[slot - 1] > i) { slot--; }
546544 return slot;
547545 }
548546