From 1b02fc26c471c3d367a767ff33e30bbdd7553e57 Mon Sep 17 00:00:00 2001 From: rjbaucells Date: Tue, 5 May 2015 20:05:50 -0400 Subject: [PATCH] Revert "Do not call equal() for all items" This reverts commit 0edf1fe27f9b1ce25d63b6024db5e5d32070d24d. --- lib/type/matrix/util/algorithm04.js | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/lib/type/matrix/util/algorithm04.js b/lib/type/matrix/util/algorithm04.js index c50fd69ee..c8d26aa34 100644 --- a/lib/type/matrix/util/algorithm04.js +++ b/lib/type/matrix/util/algorithm04.js @@ -110,22 +110,11 @@ function factory (type, config, load) { // check row exists in workspace if (w[i] === mark) { // check we need to process values - if (x) { - // invoke callback - var v = cf(x[i], bvalues[k]); - // check for zero value - if (!ef(v, zero)) { - // store value - x[i] = v; - } - else { - // remove mark (index will be updated below) - w[i] = null; - } - } + if (x) + x[i] = cf(x[i], bvalues[k]); } else { - // update c (i not yet on c) + // update c cindex.push(i); // update workspace w[i] = mark; @@ -142,10 +131,12 @@ function factory (type, config, load) { while (k < cindex.length) { // row i = cindex[k]; - // check we have a mark @ i - if (w[i] === mark) { + // value @ i + var v = x[i]; + // check for zero value + if (!ef(v, zero)) { // push value - cvalues.push(x[i]); + cvalues.push(v); // increment pointer k++; }