Created
December 6, 2009 03:56
-
-
Save aarongustafson/250041 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var iterations = Math.floor(values.length / 8); | |
var leftover = values.length % 8; | |
var i = 0; | |
if ( leftover > 0 ) | |
{ | |
do { | |
process( values[i++] ); | |
} while ( --leftover > 0 ); | |
} | |
do { | |
process(values[i++]); | |
process(values[i++]); | |
process(values[i++]); | |
process(values[i++]); | |
process(values[i++]); | |
process(values[i++]); | |
process(values[i++]); | |
process(values[i++]); | |
} while ( --iterations > 0 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var iterations = Math.ceil( values.length / 8 ); | |
var startAt = values.length % 8; | |
var i = 0; | |
do { | |
switch(startAt) | |
{ | |
case 0: process(values[i++]); | |
case 7: process(values[i++]); | |
case 6: process(values[i++]); | |
case 5: process(values[i++]); | |
case 4: process(values[i++]); | |
case 3: process(values[i++]); | |
case 2: process(values[i++]); | |
case 1: process(values[i++]); | |
} | |
startAt = 0; | |
} while (--iterations > 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment