User "Catrope" changed the status of MediaWiki.r103447.

Old Status: new
New Status: fixme

User "Catrope" also posted a comment on MediaWiki.r103447.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/103447#c26142
Commit summary:

Reduced (dramatically) the number of re-renders on insert (but there's still 
more duplication being done atm, especially on load)

Comment:

<pre>
+       parent.splice.apply(
+               parent, [index, remove].concat( 
es.DocumentModel.createNodesFromData( newData ) )
+       );
</pre>
You should use es.insertIntoArray() or whatever it's called here, because the 
number of elements in the return value of createNodesFromData() is unbounded.

<pre>
-               for ( i = 0; i < maxDepth; i++ ) {
+               for ( i = 1; i < maxDepth; i++ ) {
                        node = node.getParent();
                }
</pre>
Using <code>i = 0; i < maxDepth - 1;</code> would be clearer.

<pre>
+               index = node.getIndexFromOffset( this.cursor );
</pre>
As mentioned in r103377, this has a local vs global offset problem. Strangely, 
the code in the else branch does do this correctly.

This code is not easy to understand because getScope() is undocumented. In 
getScope(), the maxDepth variable is very strangely named given that it tracks 
"negative depth" (i.e. it goes up).

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to