Skip to content
Snippets Groups Projects
Commit 776d64f8 authored by Thomas Tanghus's avatar Thomas Tanghus
Browse files

Cache Object.keys(this.vars)

parent ca495758
No related branches found
No related tags found
No related merge requests found
...@@ -60,9 +60,10 @@ ...@@ -60,9 +60,10 @@
var self = this; var self = this;
if(typeof this.options.escapeFunction === 'function') { if(typeof this.options.escapeFunction === 'function') {
for (var key = 0; key < Object.keys(this.vars).length; key++) { var keys = Object.keys(this.vars);
if(typeof this.vars[Object.keys(this.vars)[key]] === 'string') { for (var key = 0; key < keys.length; key++) {
this.vars[Object.keys(this.vars)[key]] = self.options.escapeFunction(this.vars[Object.keys(this.vars)[key]]); if(typeof this.vars[keys[key]] === 'string') {
this.vars[keys[key]] = self.options.escapeFunction(this.vars[keys[key]]);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment