File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
src/main/java/me/rothes/protocolstringreplacer/replacer Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -450,22 +450,18 @@ public List<Integer> getPapiIndexes(@Nonnull List<Replaceable> replaceables) {
450450 }
451451
452452 public boolean hasPlaceholder (@ NotNull String string ) {
453- boolean headFound = false ;
454- boolean tailFound = false ;
455- for (int i = 0 ; i < string .length (); i ++) {
456- char Char = string .charAt (i );
457- if (!headFound ) {
458- if (Char == papiHead ) {
459- headFound = true ;
460- }
461- } else {
462- if (Char == papiTail ) {
463- tailFound = true ;
464- break ;
453+ boolean findHead = true ;
454+ for (int i = 0 , length = string .length (); i < length ; i ++) {
455+ char ch = string .charAt (i );
456+ if (findHead ) {
457+ if (ch == papiHead ) {
458+ findHead = false ;
465459 }
460+ } else if (ch == papiTail ) {
461+ return true ;
466462 }
467463 }
468- return tailFound ;
464+ return false ;
469465 }
470466
471467 public String setPlaceholder (@ NotNull PsrUser user , @ NotNull String string ) {
You can’t perform that action at this time.
0 commit comments