Skip to content

Commit

Permalink
Use min(desiredLength, commitIdLength) for substring
Browse files Browse the repository at this point in the history
  • Loading branch information
Antti Pitkanen committed Dec 30, 2013
1 parent c5c3489 commit 1d328e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/flowdock/jenkins/TeamInboxMessage.java
Expand Up @@ -135,6 +135,6 @@ private static String commitId(Entry commit) {

private static String commitId(Entry commit, int length) {
String id = commitId(commit);
return id.substring(0, Math.max(length, id.length()));
return id.substring(0, Math.min(length, id.length()));
}
}

0 comments on commit 1d328e4

Please sign in to comment.