stevedlawrence commented on a change in pull request #237: Fixes DAFFODIL-2142
URL: https://github.com/apache/incubator-daffodil/pull/237#discussion_r295346700
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/dsom/ModelGroup.scala
##########
@@ -44,7 +44,7 @@ object ModelGroupFactory {
/**
* Because of the contexts where this is used, we return a list. That lets
users
- * flatmap it to get a collection of model groups. Nil for non-model groups,
non-Nil for the model group
+ * flatmap it to get a collection of model groups. It will return non-Nil
for the model group
* object. There should be only one non-Nil.
Review comment:
Ah, your right, the flatMap is still needed. Only suggestion is the switch
to an Option for the flatmap since it only flaMaps a Nil or List of one. So
replace Nil with None and List(...) with Some(...) Some(...) insead of List.
Functionally it's exactly the same thing, but I think more accurately shows
that you either have one thing or no things, and the no things get dropped.
Also, in the future, avoid squashing and force-pushing until all comments
are address and you get enough +1's for the PR to be accepted. Github doesn't
show differences between squashes at all, so it's difficult to figure out what
updates have been made to the PR.
+1 :+1:
----------------------------------------------------------------
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