on master help sign in
Improve readability
6aa8b91Christian Widera
libraries/Native/Array.js+2−4
@@ -36,10 +36,8 @@ Elm.Native.Array.make = function(elm) {
36 function unsafeGet(i, array) {
36 function unsafeGet(i, array) {
37 for (var x = array.height; x > 0; x--) {
37 for (var x = array.height; x > 0; x--) {
38 var slot = Math.floor(i / cache[x]);
38 var slot = Math.floor(i / cache[x]);
39− while (array.lengths[slot] <= i) {
39+ while (array.lengths[slot] <= i) { slot++; }
40− slot++;
41− }
42− i -= slot > 0 ? array.lengths[slot - 1] : 0;
40+ if (slot > 0) { i -= array.lengths[slot - 1]; }
43 array = array.table[slot];
41 array = array.table[slot];
44 }
42 }
45 return array.table[i];
43 return array.table[i];