Skip to content

Commit 55436a4

Browse files
authored
Merge pull request #2165 from wuare/chore/optimize-code
chore: optimize code
2 parents 260dba8 + 239cdae commit 55436a4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/java/org/apache/ibatis/builder/xml/XMLConfigBuilder.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,11 @@ private void mapperElement(XNode parent) throws Exception {
396396
private boolean isSpecifiedEnvironment(String id) {
397397
if (environment == null) {
398398
throw new BuilderException("No environment specified.");
399-
} else if (id == null) {
399+
}
400+
if (id == null) {
400401
throw new BuilderException("Environment requires an id attribute.");
401-
} else if (environment.equals(id)) {
402-
return true;
403402
}
404-
return false;
403+
return environment.equals(id);
405404
}
406405

407406
}

0 commit comments

Comments
 (0)