Skip to content

Commit e387c23

Browse files
Slightly simplify error message rebuilding
This removes some duplicate code for with and without column number by building the column number string separately first.
1 parent 8e9f7a6 commit e387c23

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

arduino-core/src/cc/arduino/Compiler.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -582,11 +582,8 @@ public void message(String s) {
582582
String fileName = ex.getCodeFile().getPrettyName();
583583
int lineNum = ex.getCodeLine() + 1;
584584
int colNum = ex.getCodeColumn();
585-
if (colNum != -1) {
586-
s = fileName + ":" + lineNum + ":" + colNum + ": error: " + error + msg;
587-
} else {
588-
s = fileName + ":" + lineNum + ": error: " + error + msg;
589-
}
585+
String column = (colNum != -1) ? (":" + colNum) : "";
586+
s = fileName + ":" + lineNum + column + ": error: " + error + msg;
590587
}
591588

592589
if (ex != null) {

0 commit comments

Comments
 (0)