From 64809d9ae23dc24f47accd4b4788b48f49880d3e Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Mon, 4 May 2015 12:53:02 -0700 Subject: [PATCH] [TASK] add short circuit when there are no direct nor autobridged offers --- src/js/ripple/orderbook.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/ripple/orderbook.js b/src/js/ripple/orderbook.js index 87396f3fd4..a313e804c8 100644 --- a/src/js/ripple/orderbook.js +++ b/src/js/ripple/orderbook.js @@ -1223,6 +1223,10 @@ OrderBook.prototype.computeAutobridgedOffers = function() { OrderBook.prototype.mergeDirectAndAutobridgedBooks = function() { var self = this; + if (_.isEmpty(this._offers) && _.isEmpty(this._offersAutobridged)) { + return null; + } + this._mergedOffers = this._offers .concat(this._offersAutobridged) .sort(function(a, b) {