on master help sign in
Improve readability
commit6aa8b91f0525d0da9c6dc8af80673ffedde29979 authorChristian Widera <xash@posteo.de> dateTue 22 Apr 2014, 13:02 (13 years ago) parent0841ce2
1 file changed+2−4
libraries/Native/Array.js+2−4
libraries/Native/Array.js+2−4
@@ -36,10 +36,8 @@ Elm.Native.Array.make = function(elm) {
3636 function unsafeGet(i, array) {
3737 for (var x = array.height; x > 0; x--) {
3838 var slot = Math.floor(i / cache[x]);
39− while (array.lengths[slot] <= i) {
40− slot++;
41− }
42− i -= slot > 0 ? array.lengths[slot - 1] : 0;
39+ while (array.lengths[slot] <= i) { slot++; }
40+ if (slot > 0) { i -= array.lengths[slot - 1]; }
4341 array = array.table[slot];
4442 }
4543 return array.table[i];