Skip to content

Commit

Permalink
Spare NumberUtils.toInt() exception handling for common case of statu…
Browse files Browse the repository at this point in the history
…sCode == "-"
  • Loading branch information
kngenie committed Mar 8, 2016
1 parent 04301cb commit 8118b47
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ protected boolean include(CDXLine line) {

String timestamp = line.getTimestamp();
timestamp = timestamp.substring(0, Math.min(timestampDedupLength, timestamp.length()));
int httpCode = NumberUtils.toInt(line.getStatusCode(), WORST_HTTP_CODE);
final String statusCode = line.getStatusCode();
int httpCode = "-".equals(statusCode) ? WORST_HTTP_CODE : NumberUtils.toInt(statusCode, WORST_HTTP_CODE);

boolean isDupe = false;

Expand Down

0 comments on commit 8118b47

Please sign in to comment.