Minor optimisation to the list macro

By moving the compiling of the template outside of the main loop
print-window-tiddler
Jeremy Ruston 2012-01-08 11:03:20 +00:00
rodzic bc16400ef2
commit 14e252590c
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -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>");