[Jifty-commit] r3574 - jifty/branches/trimclient/share/web/static/js

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue Jun 26 20:42:22 EDT 2007


Author: clkao
Date: Tue Jun 26 20:42:21 2007
New Revision: 3574

Modified:
   jifty/branches/trimclient/share/web/static/js/jifty.js

Log:
kill boring array enumeration for "find"

Modified: jifty/branches/trimclient/share/web/static/js/jifty.js
==============================================================================
--- jifty/branches/trimclient/share/web/static/js/jifty.js	(original)
+++ jifty/branches/trimclient/share/web/static/js/jifty.js	Tue Jun 26 20:42:21 2007
@@ -1134,16 +1134,10 @@
              response_fragment != null && response_fragment.nodeName == 'fragment';
              response_fragment = response_fragment.nextSibling) {
 
-            var f; 
-            for (var i = 0; i < expected_fragments.length; i++) {
-                f = expected_fragments[i];
-                if (response_fragment.getAttribute("id") == f['region'])
-                    break;
-            }
-            if (response_fragment.getAttribute("id") != f['region'])
+            var exp_id = response_fragment.getAttribute("id");
+            if (!expected_fragments.find(function(f) { return exp_id == f['region'] }))
                 continue;
 
-
             try {
                 apply_fragment_updates(response_fragment, f);
             }catch (e) { alert(e) }


More information about the Jifty-commit mailing list