Skip to content

Commit 239cdae

Browse files
author
wuxinjie1
committed
chore: optimize code
1 parent 260dba8 commit 239cdae

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)