Skip to content

Commit

Permalink
Use String.indexOf() instead of String.contains()
Browse files Browse the repository at this point in the history
String.indexOf() is char-based and hence faster than general-purpose
String-based String.contains().

Signed-off-by: Robert Varga <nite@hq.sk>
  • Loading branch information
rovarga committed Sep 2, 2017
1 parent 8639398 commit 23d1596
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -36,7 +36,7 @@ public void resetTypeId() {

@Override
protected ScalarEvent _scalarEvent(String value, Character style) {
if (value.contains("\n")) {
if (value.indexOf('\n') != -1) {
style = Character.valueOf('|');
}

Expand Down

0 comments on commit 23d1596

Please sign in to comment.