Polishing

This commit is contained in:
Andy Wilkinson
2016-08-10 17:08:18 +01:00
parent a9305cba87
commit b430a88796
3 changed files with 10 additions and 12 deletions

View File

@@ -82,10 +82,14 @@ public final class SnippetMatchers {
}
protected void addLine(int index, String line) {
if (index < 0) {
index = index + this.lines.size();
this.lines.add(determineIndex(index), line);
}
private int determineIndex(int index) {
if (index >= 0) {
return index;
}
this.lines.add(index, line);
return index + this.lines.size();
}
@Override