boolean (char c) { CharSequence text = myText; int len = text.length(); if (len > TEXT_MATCHES_THRESHOLD) { char[] chars = CharArrayUtil.fromSequenceWithoutCopying(text); if (chars != null) { for (char aChar : chars) { if (aChar == c) return true; } return false; } } for (int i = 0; i < len; ++i) { if (c == text.charAt(i)) return true; } return false; }