joerghoh commented on code in PR #2182:
URL: https://github.com/apache/jackrabbit-oak/pull/2182#discussion_r2002982448
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/tree/impl/AbstractTree.java:
##########
@@ -125,17 +120,7 @@ protected Iterable<String> getChildNames() {
NodeBuilder nodeBuilder = getNodeBuilder();
PropertyState order = nodeBuilder.getProperty(OAK_CHILD_ORDER);
if (order != null && order.getType() == NAMES) {
- Set<String> names =
SetUtils.toLinkedSet(nodeBuilder.getChildNodeNames());
- List<String> ordered = new ArrayList<>(names.size());
- for (String name : order.getValue(NAMES)) {
- // only include names of child nodes that actually exist
- if (names.remove(name)) {
- ordered.add(name);
- }
- }
- // add names of child nodes that are not explicitly ordered
- ordered.addAll(names);
- return ordered;
+ return new OrderedChildnameIterable(order.getValue(NAMES),
nodeBuilder.getChildNodeNames());
Review Comment:
Good hint, that makes things a bit easier.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]