Skip to content

Commit

Permalink
User indexOf(char) instead of indexOf(String).
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Aug 23, 2015
1 parent ed84551 commit a05ca52
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public String getNoteTitle() {
* @param title short text description (no newlines or tabs); use null if none
*/
public void setNoteTitle(String title) {
if (title.indexOf("\n") >= 0 || title.indexOf("\t") >= 0)
if (title.indexOf('\n') >= 0 || title.indexOf('\t') >= 0)
throw new IllegalArgumentException("Comments cannot contain newlines or tabs.");
noteTitle = title;
}
Expand Down Expand Up @@ -448,7 +448,7 @@ public String[] getNoteComments() {
public void setNoteComments(String[] comments) {
if (comments != null)
for (String comment : comments)
if (comment.indexOf("\n") >= 0 || comment.indexOf("\t") >= 0)
if (comment.indexOf('\n') >= 0 || comment.indexOf('\t') >= 0)
throw new IllegalArgumentException("Comments cannot contain newlines or tabs.");
noteComments = comments == null ? null : Arrays.copyOf(comments, comments.length);
}
Expand Down

0 comments on commit a05ca52

Please sign in to comment.