1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-22 11:52:14 +01:00

Slightly simplify error message rebuilding

This removes some duplicate code for with and without column number by
building the column number string separately first.
This commit is contained in:
Matthijs Kooijman 2020-01-28 15:16:41 +01:00
parent 8e9f7a630a
commit e387c23b60

View File

@ -582,11 +582,8 @@ public class Compiler implements MessageConsumer {
String fileName = ex.getCodeFile().getPrettyName(); String fileName = ex.getCodeFile().getPrettyName();
int lineNum = ex.getCodeLine() + 1; int lineNum = ex.getCodeLine() + 1;
int colNum = ex.getCodeColumn(); int colNum = ex.getCodeColumn();
if (colNum != -1) { String column = (colNum != -1) ? (":" + colNum) : "";
s = fileName + ":" + lineNum + ":" + colNum + ": error: " + error + msg; s = fileName + ":" + lineNum + column + ": error: " + error + msg;
} else {
s = fileName + ":" + lineNum + ": error: " + error + msg;
}
} }
if (ex != null) { if (ex != null) {