
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 { |
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
/** | |
* 1. Original JS Implementation by Jeff Greenberg 2/2001 - http://home.earthlink.net/~kendrasg/info/js_opt/ | |
* 2. (fast duff's device) from an anonymous donor to Jeff Greenberg's site | |
* 3. (faster duff's defice) by Andrew King 8/2002 for WebSiteOptimization.com | |
* 4. bug fix (for iterations<8) by Andrew B. King April 12, 2003 | |
*/ | |
function duffsDevice (iterations) { | |
var testVal = 0, | |
n = iterations % 8; |