This does not quite make sense, but can be optimized to only quickly
look at the collection.
Change-Id: Iabc8414ff712126699f54c02f5aaf9506c4f3f6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
1adcabecdcab85b6ed657271758560fc5eeb917f)
package org.opendaylight.yangtools.yang.model.util;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@Override
public boolean hasNext() {
- if (container.getChildNodes() != null) {
- final Collection<DataSchemaNode> childNodes = container.getChildNodes();
-
- if (childNodes != null && !childNodes.isEmpty()) {
- return childNodes.iterator().hasNext();
- }
- }
- return false;
+ return !container.getChildNodes().isEmpty();
}
@Override