mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
WEB-61150 isQuotedString: improve performance.
GitOrigin-RevId: 64c3060db9242a5b268f080ef992ab500631a719
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9e854c9d5a
commit
f4ea6a80ec
@@ -404,7 +404,11 @@ public class StringUtilRt {
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
public static boolean isQuotedString(@NotNull String s) {
|
||||
return s.length() > 1 && (s.charAt(0) == '\'' || s.charAt(0) == '\"') && s.charAt(0) == s.charAt(s.length() - 1);
|
||||
int length = s.length();
|
||||
if (length <= 1) return false;
|
||||
char firstChar = s.charAt(0);
|
||||
if (firstChar != '\'' && firstChar != '\"') return false;
|
||||
return firstChar == s.charAt(length - 1);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user