Minor optimisation to the list macro

By moving the compiling of the template outside of the main loop
This commit is contained in:
Jeremy Ruston committed 2012-01-08 11:03:20 +00:00
1 parent bc16400ef2
commit 14e252590c
1 file changed
+2 -1
+2 -1
View File
@@ -61,10 +61,11 @@ exports.macro = {
if(tiddlers.length === 0) {
return params.emptyMessage ? encoder(params.emptyMessage) : "";
} else {
var fn = store.compileText(templateType,templateText,type);
pushTag("<ul>");
for(t=0; t<tiddlers.length; t++) {
pushTag("<li>");
output.push(store.renderText(templateType,templateText,type,tiddlers[t]));
output.push(fn(store.getTiddler(tiddlers[t]),store,utils));
pushTag("</li>");
}
pushTag("</ul>");