Fix AB6, code style
This commit is contained in:
@ -138,15 +138,13 @@ public class HierarchicalSystem implements CosmicSystem, MassiveIterable {
|
||||
public Massive next() {
|
||||
if (cur != null && cur.hasNext()) return cur.next();
|
||||
|
||||
for (; i < all.length; i++) {
|
||||
CosmicSystem sys = all[i];
|
||||
while (i < all.length) {
|
||||
CosmicSystem sys = all[i++];
|
||||
if (sys instanceof NamedBodyForcePair m) {
|
||||
i++;
|
||||
return m.getBody();
|
||||
} else if (sys instanceof HierarchicalSystem hs) {
|
||||
cur = hs.iterator();
|
||||
if (cur.hasNext()) {
|
||||
i++;
|
||||
return cur.next();
|
||||
}
|
||||
}
|
||||
@ -159,14 +157,14 @@ public class HierarchicalSystem implements CosmicSystem, MassiveIterable {
|
||||
public boolean hasNext() {
|
||||
if (cur != null && cur.hasNext()) return true;
|
||||
|
||||
for (; i < all.length; i++) {
|
||||
while (i < all.length) {
|
||||
CosmicSystem sys = all[i];
|
||||
if (sys instanceof NamedBodyForcePair) {
|
||||
return true;
|
||||
} else if (sys instanceof HierarchicalSystem hs) {
|
||||
if (sys instanceof NamedBodyForcePair) return true;
|
||||
i++;
|
||||
|
||||
if (sys instanceof HierarchicalSystem hs) {
|
||||
cur = hs.iterator();
|
||||
if (cur.hasNext()) {
|
||||
i++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user