Skip to content
Permalink
Browse files
Simplify conditions and avoid extra checks.
  • Loading branch information
arturobernalg authored and darkma773r committed May 5, 2022
1 parent 72c2113 commit 69260fa1e9c4f87b1abf1c301825a53a722b6007
Showing 3 changed files with 5 additions and 8 deletions.
@@ -308,9 +308,7 @@ protected void addPropertyInternal(final String key, final Object value) {

@Override
protected void clearInternal() {
if (configs != null) {
this.getCurrentConfig().clear();
}
this.getCurrentConfig().clear();
}

@Override
@@ -505,9 +503,7 @@ protected int sizeInternal() {

@Override
protected void setPropertyInternal(final String key, final Object value) {
if (configs != null) {
this.getCurrentConfig().setProperty(key, value);
}
this.getCurrentConfig().setProperty(key, value);
}

@Override
@@ -709,10 +709,11 @@ private String escapeComments(final String value) {
final String commentChars = getCommentLeadingCharsUsedInInput();
boolean quoted = false;

for (int i = 0; i < commentChars.length() && !quoted; i++) {
for (int i = 0; i < commentChars.length(); i++) {
final char c = commentChars.charAt(i);
if (value.indexOf(c) != -1) {
quoted = true;
break;
}
}

@@ -256,7 +256,7 @@ public URL locateFromURL(final String basePath, final String fileName) {

file = getManager().resolveFile(base, fileName);
} else {
final FileSystemOptions opts = fileScheme != null ? getOptions(fileScheme) : null;
final FileSystemOptions opts = getOptions(fileScheme);
file = getManager().resolveFile(fileName, opts);
}

0 comments on commit 69260fa

Please sign in to comment.