Skip to content

Commit b484809

Browse files
committed
Reduce redundancy.
1 parent 082bb34 commit b484809

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/org/apache/ibatis/jdbc/ScriptRunner.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private void executeLineByLine(Reader reader) {
140140
BufferedReader lineReader = new BufferedReader(reader);
141141
String line;
142142
while ((line = lineReader.readLine()) != null) {
143-
command = handleLine(command, line);
143+
handleLine(command, line);
144144
}
145145
commitConnection();
146146
checkForMissingLineTerminator(command);
@@ -195,13 +195,12 @@ private void checkForMissingLineTerminator(StringBuilder command) {
195195
}
196196
}
197197

198-
private StringBuilder handleLine(StringBuilder command, String line) throws SQLException {
198+
private void handleLine(StringBuilder command, String line) throws SQLException {
199199
String trimmedLine = line.trim();
200200
if (lineIsComment(trimmedLine)) {
201201
Matcher matcher = DELIMITER_PATTERN.matcher(trimmedLine);
202202
if (matcher.find()) {
203203
delimiter = matcher.group(5);
204-
return command;
205204
}
206205
println(trimmedLine);
207206
} else if (commandReadyToExecute(trimmedLine)) {
@@ -214,7 +213,6 @@ private StringBuilder handleLine(StringBuilder command, String line) throws SQLE
214213
command.append(line);
215214
command.append(LINE_SEPARATOR);
216215
}
217-
return command;
218216
}
219217

220218
private boolean lineIsComment(String trimmedLine) {

0 commit comments

Comments
 (0)