Created
October 31, 2018 18:47
-
-
Save vhsu/ae9981efdf880939fa398f928bb8d079 to your computer and use it in GitHub Desktop.
combiLoopOptimizer
This file contains hidden or 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
//This is used in findBalancedSets function, to reduce processing time for large sets of combinations | |
function combiLoopOptimizer(combinationsR, playerNames) { | |
var start = 0; | |
var skipRanges = []; | |
skipRanges.length = combinationsR[0].length; | |
for (var i = playerNames.length; i >= 0; i--) { | |
//size of range to skip | |
var temp = Math.floor(getTotalCombinations(i - 1, teamsize - 1)); | |
//start of range to skip | |
var endTemp = start + temp + 1; | |
skipRanges.fill(start, start, endTemp) | |
start = start + temp | |
} | |
return skipRanges | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment