@@ -35,10 +35,8 @@ Elm.Native.Array.make = function(elm) {
3535 function unsafeGet(i, array) {
3636 for (var x = array.height; x > 0; x--) {
3737 var slot = i >> (x * 5);
38− if (slot > 0) {
39− while (array.lengths[slot - 1] > i) { slot--; }
40− i -= array.lengths[slot - 1];
41− }
38+ while (array.lengths[slot] <= i) slot++;
39+ if (slot > 0) i -= array.lengths[slot - 1];
4240 array = array.table[slot];
4341 }
4442 return array.table[i];
@@ -558,7 +556,7 @@ Elm.Native.Array.make = function(elm) {
558556 // find the exact slot via forward searching in "lengths". Returns the index.
559557 function getSlot(i, a) {
560558 var slot = i >> (5 * a.height);
561− while (a.lengths[slot - 1] > i) { slot--; }
559+ while (a.lengths[slot] <= i) slot++;
562560 return slot;
563561 }
564562