diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2013-08-28 12:50:05 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2013-08-28 12:50:05 +0200 |
commit | 776d64f804534eee724a9cd08f6c242002a75ddc (patch) | |
tree | c15d2b5e1bb445e20462ec137482bfa1b39d5574 /core/js | |
parent | ca495758bd8bcbea66f00296d36d87f66cd5f4a8 (diff) | |
download | nextcloud-server-776d64f804534eee724a9cd08f6c242002a75ddc.tar.gz nextcloud-server-776d64f804534eee724a9cd08f6c242002a75ddc.zip |
Cache Object.keys(this.vars)
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/octemplate.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/js/octemplate.js b/core/js/octemplate.js index f7ee316f3b2..46ffa976574 100644 --- a/core/js/octemplate.js +++ b/core/js/octemplate.js @@ -60,9 +60,10 @@ 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]]); } } } |