aboutsummaryrefslogtreecommitdiff
path: root/src/utility.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-11-23 18:23:52 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-11-23 18:23:52 -0800
commit309659d7b214828841540dd14de217b2058ce96e (patch)
tree36dde00cef133c162b63070f4ac4d3587efa174f /src/utility.js
parent8d030228a3a428f2450d4d77651d04347a1211e9 (diff)
replace compiler tricks for one-time loop removal and label removal with a proper pass in the js optimizer
Diffstat (limited to 'src/utility.js')
-rw-r--r--src/utility.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utility.js b/src/utility.js
index ba97a399..f0439ea7 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -135,6 +135,10 @@ function sumStringy(x) {
return x.reduce(function(a,b) { return a+b }, '');
}
+function filterTruthy(x) {
+ return x.filter(function(y) { return !!y });
+}
+
function loopOn(array, func) {
for (var i = 0; i < array.length; i++) {
func(i, array[i]);