1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-24 22:33:16 +00:00

Reducing function calls across board (#4102)

This commit is contained in:
Cameron Fischer 2019-07-14 11:20:27 -04:00 committed by Jeremy Ruston
parent cb77f3f503
commit b67e088e55

View File

@ -385,9 +385,10 @@ Widget.prototype.previousSibling = function() {
Render the children of this widget into the DOM Render the children of this widget into the DOM
*/ */
Widget.prototype.renderChildren = function(parent,nextSibling) { Widget.prototype.renderChildren = function(parent,nextSibling) {
$tw.utils.each(this.children,function(childWidget) { var children = this.children;
childWidget.render(parent,nextSibling); for(var i = 0; i < children.length; i++) {
}); children[i].render(parent,nextSibling);
};
}; };
/* /*
@ -455,11 +456,11 @@ Widget.prototype.refreshSelf = function() {
Refresh all the children of a widget Refresh all the children of a widget
*/ */
Widget.prototype.refreshChildren = function(changedTiddlers) { Widget.prototype.refreshChildren = function(changedTiddlers) {
var self = this, var children = this.children,
refreshed = false; refreshed = false;
$tw.utils.each(this.children,function(childWidget) { for (var i = 0; i < children.length; i++) {
refreshed = childWidget.refresh(changedTiddlers) || refreshed; refreshed = children[i].refresh(changedTiddlers) || refreshed;
}); }
return refreshed; return refreshed;
}; };