@@ 10580-10603 (lines=24) @@ | ||
10577 | ||
10578 | // Reduces the specified selected or deselected records. |
|
10579 | // This function is only used when the cardinality is greater than 1. |
|
10580 | function updateMany(filterOne, added, removed) { |
|
10581 | if (filterOne === one || resetNeeded) return; |
|
10582 | ||
10583 | var i, |
|
10584 | k, |
|
10585 | n, |
|
10586 | g; |
|
10587 | ||
10588 | // Add the added values. |
|
10589 | for (i = 0, n = added.length; i < n; ++i) { |
|
10590 | if (!(filters[k = added[i]] & zero)) { |
|
10591 | g = groups[groupIndex[k]]; |
|
10592 | g.value = reduceAdd(g.value, data[k]); |
|
10593 | } |
|
10594 | } |
|
10595 | ||
10596 | // Remove the removed values. |
|
10597 | for (i = 0, n = removed.length; i < n; ++i) { |
|
10598 | if ((filters[k = removed[i]] & zero) === filterOne) { |
|
10599 | g = groups[groupIndex[k]]; |
|
10600 | g.value = reduceRemove(g.value, data[k]); |
|
10601 | } |
|
10602 | } |
|
10603 | } |
|
10604 | ||
10605 | // Reduces the specified selected or deselected records. |
|
10606 | // This function is only used when the cardinality is 1. |
|
@@ 10607-10628 (lines=22) @@ | ||
10604 | ||
10605 | // Reduces the specified selected or deselected records. |
|
10606 | // This function is only used when the cardinality is 1. |
|
10607 | function updateOne(filterOne, added, removed) { |
|
10608 | if (filterOne === one || resetNeeded) return; |
|
10609 | ||
10610 | var i, |
|
10611 | k, |
|
10612 | n, |
|
10613 | g = groups[0]; |
|
10614 | ||
10615 | // Add the added values. |
|
10616 | for (i = 0, n = added.length; i < n; ++i) { |
|
10617 | if (!(filters[k = added[i]] & zero)) { |
|
10618 | g.value = reduceAdd(g.value, data[k]); |
|
10619 | } |
|
10620 | } |
|
10621 | ||
10622 | // Remove the removed values. |
|
10623 | for (i = 0, n = removed.length; i < n; ++i) { |
|
10624 | if ((filters[k = removed[i]] & zero) === filterOne) { |
|
10625 | g.value = reduceRemove(g.value, data[k]); |
|
10626 | } |
|
10627 | } |
|
10628 | } |
|
10629 | ||
10630 | // Recomputes the group reduce values from scratch. |
|
10631 | // This function is only used when the cardinality is greater than 1. |