You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2022/01/11 21:10:33 UTC

[GitHub] [daffodil] mbeckerle commented on a change in pull request #724: Improve performance of XMLUtils.coalesceAllAdjacentTextNodes

mbeckerle commented on a change in pull request #724:
URL: https://github.com/apache/daffodil/pull/724#discussion_r782527095



##########
File path: daffodil-lib/src/main/scala/org/apache/daffodil/xml/XMLUtils.scala
##########
@@ -360,9 +360,7 @@ object XMLUtils {
         tn = null
       }
     }
-    while (i < seq.length) {

Review comment:
       Always bugs the crap out of me when people use the word "sequence" instead of "list", but the implementation doesn't have O(1) indexing and length. 
   If it's a linked list, call it a LIST !
   In this case; however, it's a sequence of XML nodes right? I.e., a scala.xml.NodeSeq ? 
   
   Suggest adding a comment to the code just to remind people that scala.xml node sequences are LISTS with linear time access to an indexed location or to determine length, so map, or foreach are preferred for traversing them. 
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org