Skip to content

Commit

Permalink
Tested CachedYamlLine
Browse files Browse the repository at this point in the history
  • Loading branch information
SherifWaly committed Mar 6, 2017
1 parent bab5214 commit 7d63c75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/main/java/com/amihaiemil/camel/CachedYamlLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ final class CachedYamlLine implements YamlLine {
/**
* Cached indentation.
*/
private int indentation;
private int indentation = -1;

/**
* Ctor.
* @param line YamlLine
*/
CachedYamlLine(final YamlLine line) {
this.line = line;
this.trimmed = null;
this.indentation = -1;
}

@Override
Expand Down
6 changes: 1 addition & 5 deletions src/test/java/com/amihaiemil/camel/CachedYamlLineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ public void cachesIndentationValue() {
YamlLine line = new CachedYamlLine(
new RtYamlLine(" this line", 12)
);

//Fast performance for large number of calls.
for(int i = 0; i < 1000000; i++) {
MatcherAssert.assertThat(line.indentation(), Matchers.is(12));
}
MatcherAssert.assertThat(line.indentation(), Matchers.is(12));
}
}

0 comments on commit 7d63c75

Please sign in to comment.