Skip to content

Commit

Permalink
feat(objectionary#546): objects POC off
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Nov 19, 2024
1 parent bdf2a9b commit 06da3f7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/org/eolang/jeo/representation/xmir/XmlNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.eolang.jeo.representation.directives.JeoFqn;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

/**
* XML smart element.
Expand Down Expand Up @@ -259,11 +260,12 @@ private IllegalStateException notFound(final String name) {
* Objects.
* @return Stream of class objects.
*/
private Stream<XML> objects() {
final List<XML> nodes = new XMLDocument(this.node).nodes("node()");
final List<XML> res = new ArrayList<>(nodes.size());
for (final XML child : nodes) {
if ("o".equals(child.node().getNodeName())) {
private Stream<Node> objects() {
final NodeList children = this.node.getChildNodes();
final List<Node> res = new ArrayList<>(children.getLength());
for (int index = 0; index < children.getLength(); ++index) {
final Node child = children.item(index);
if ("o".equals(child.getNodeName())) {
res.add(child);
}
}
Expand Down

0 comments on commit 06da3f7

Please sign in to comment.