Created
May 23, 2012 13:09
-
-
Save nodeninja/2775158 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
function createExchange(exchangeData) { | |
function init(exchange, orderType) { | |
if (!exchange[orderType]) { | |
exchange[orderType] = {}; | |
exchange[orderType].volumes = {}; | |
exchange[orderType].prices = createBinaryHeap(); | |
} | |
} | |
var cloned = $.extend(true, {}, exchangeData); | |
cloned.trades = []; | |
init(cloned, BUY); | |
init(cloned, SELL); | |
return cloned; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment