]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cache Object.keys(this.vars)
authorThomas Tanghus <thomas@tanghus.net>
Wed, 28 Aug 2013 10:50:05 +0000 (12:50 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Wed, 28 Aug 2013 10:50:05 +0000 (12:50 +0200)
core/js/octemplate.js

index f7ee316f3b206526325e4b0a5e15f0c51be25b4e..46ffa9765741e25b2d86f31728a74db3ac6e1784 100644 (file)
                        var self = this;
 
                        if(typeof this.options.escapeFunction === 'function') {
-                               for (var key = 0; key < Object.keys(this.vars).length; key++) {
-                                       if(typeof this.vars[Object.keys(this.vars)[key]] === 'string') {
-                                               this.vars[Object.keys(this.vars)[key]] = self.options.escapeFunction(this.vars[Object.keys(this.vars)[key]]);
+                               var keys = Object.keys(this.vars);
+                               for (var key = 0; key < keys.length; key++) {
+                                       if(typeof this.vars[keys[key]] === 'string') {
+                                               this.vars[keys[key]] = self.options.escapeFunction(this.vars[keys[key]]);
                                        }
                                }
                        }