stevedlawrence commented on a change in pull request #262: Unordered sequences
URL: https://github.com/apache/incubator-daffodil/pull/262#discussion_r323996494
##########
File path:
daffodil-runtime1/src/main/scala/org/apache/daffodil/infoset/InfosetImpl.scala
##########
@@ -1007,6 +1006,15 @@ final class DIArray(
ie.setArray(this)
}
+ def concat(array: DIArray): DIArray = {
+ val newContents = array.contents
+ newContents.map( ie => {
Review comment:
This can be a foreach isntead of a map--avoids allocating a new array.
Also, it might be a good idea to not return anything. This function mutates
``this`` DIArray, and then returns it. However, I feel like generally when a
function returns the same type it gives the impression that it's creating a new
thing and doesn't modify the original. But this does modify the original. But
not returning anything, it makes it more clear that it mutates state.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services