Skip to content

Commit

Permalink
Use a simple for loop instead of a stream to improve performance (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahamlat authored Dec 5, 2023
1 parent 034b1ed commit 8392a83
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ public void commit(Trace hubTrace) {
* @return the line number in this transaction trace
*/
public int lineCount() {
return this.trace.stream().mapToInt(section -> section.getLines().size()).sum();
int sum = 0;
for (TraceSection s : trace) {
sum += s.getLines().size();
}
return sum;
}
}

0 comments on commit 8392a83

Please sign in to comment.