aboutsummaryrefslogtreecommitdiff
path: root/src/utility.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-02 23:29:02 -0700
committeralon@honor <none@none>2010-10-02 23:29:02 -0700
commit2f64c269303d4731f511e8b77e1ec8fb5f906763 (patch)
treec30b4a075239b6739efc41e3a76abada6ab93e8c /src/utility.js
parent981b5832f5c0ae8a732e5e89f313c88efdadd0e3 (diff)
add missing branch detection of default in switch. all reloop but sauer, dlmalloc/clang
Diffstat (limited to 'src/utility.js')
-rw-r--r--src/utility.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utility.js b/src/utility.js
index 3d8ce86e..d5583ffb 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -202,3 +202,14 @@ function setSub(x, y) {
return ret;
}
+// Intersection of 2 sets. Faster if |xx| << |yy|
+function setIntersect(x, y) {
+ var ret = {};
+ for (xx in x) {
+ if (xx in y) {
+ ret[xx] = true;
+ }
+ }
+ return ret;
+}
+