From 64c9fdcc28333c7310df8d9efb9040dbe3b4f8c8 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sat, 1 Jun 2013 16:38:35 +0200 Subject: [PATCH] Speed up octemplate rendering. --- core/js/octemplate.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/js/octemplate.js b/core/js/octemplate.js index e032506c0b1..352a23c4dc7 100644 --- a/core/js/octemplate.js +++ b/core/js/octemplate.js @@ -60,11 +60,9 @@ var self = this; if(typeof this.options.escapeFunction === 'function') { - $.each(this.vars, function(key, val) { - if(typeof val === 'string') { - self.vars[key] = self.options.escapeFunction(val); - } - }); + for (var key = 0; key < this.vars.length; key++) { + this.vars[key] = self.options.escapeFunction(this.vars[key]); + } } var _html = this._build(this.vars); -- 2.39.5