Skip to content

Commit

Permalink
Fix #121; respect truthiness of filterFunction.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondavies committed Aug 5, 2014
1 parent 8aad3a4 commit 6103b76
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crossfilter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function(exports){
crossfilter.version = "1.3.7";
crossfilter.version = "1.3.8";
function crossfilter_identity(d) {
return d;
}
Expand Down Expand Up @@ -825,7 +825,7 @@ function crossfilter() {
removed = [];

for (i = 0; i < n; ++i) {
if (!(filters[k = index[i]] & one) ^ (x = f(values[i], i))) {
if (filters[k = index[i]] & one ^ !(x = f(values[i], i))) {
if (x) filters[k] &= zero, added.push(k);
else filters[k] |= one, removed.push(k);
}
Expand Down
2 changes: 1 addition & 1 deletion crossfilter.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crossfilter",
"version": "1.3.7",
"version": "1.3.8",
"description": "Fast multidimensional filtering for coordinated views.",
"keywords": [
"square",
Expand Down
2 changes: 1 addition & 1 deletion src/crossfilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ function crossfilter() {
removed = [];

for (i = 0; i < n; ++i) {
if (!(filters[k = index[i]] & one) ^ (x = f(values[i], i))) {
if (filters[k = index[i]] & one ^ !(x = f(values[i], i))) {
if (x) filters[k] &= zero, added.push(k);
else filters[k] |= one, removed.push(k);
}
Expand Down
Loading

0 comments on commit 6103b76

Please sign in to comment.