Use isEmpty().
Don't nest else clauses needlessly.
@@ -322,23 +322,21 @@ public class RealMatrixFormat {
if (!rowComponents.isEmpty()) {
CompositeFormat.parseAndIgnoreWhitespace(source, pos);
if (!CompositeFormat.parseFixedstring(source, trimmedColumnSeparator, pos)) {
- if (trimmedRowSuffix.length() != 0 &&
+ if (!trimmedRowSuffix.isEmpty() &&
!CompositeFormat.parseFixedstring(source, trimmedRowSuffix, pos)) {
return null;
- } else {
+ }
CompositeFormat.parseAndIgnoreWhitespace(source, pos);
if (CompositeFormat.parseFixedstring(source, trimmedRowSeparator, pos)) {
matrix.add(rowComponents);
rowComponents = new ArrayList<>();
continue;
- } else {
- loop = false;
- }
}
+ loop = false;
}
} else {
CompositeFormat.parseAndIgnoreWhitespace(source, pos);
- if (trimmedRowPrefix.length() != 0 &&
+ if (!trimmedRowPrefix.isEmpty() &&
!CompositeFormat.parseFixedstring(source, trimmedRowPrefix, pos)) {
return null;
}
