aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/WordComposer.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r--java/src/com/android/inputmethod/latin/WordComposer.java12
1 files changed, 2 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index ac6972928..9cf71c7f4 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -149,7 +149,8 @@ public final class WordComposer {
public int copyCodePointsExceptTrailingSingleQuotesAndReturnCodePointCount(
final int[] destination) {
// lastIndex is exclusive
- final int lastIndex = mTypedWordCache.length() - trailingSingleQuotesCount();
+ final int lastIndex = mTypedWordCache.length()
+ - StringUtils.getTrailingSingleQuotesCount(mTypedWordCache);
if (lastIndex <= 0) {
// The string is empty or contains only single quotes.
return 0;
@@ -331,15 +332,6 @@ public final class WordComposer {
return mIsFirstCharCapitalized;
}
- public int trailingSingleQuotesCount() {
- final int lastIndex = mTypedWordCache.length() - 1;
- int i = lastIndex;
- while (i >= 0 && mTypedWordCache.charAt(i) == Constants.CODE_SINGLE_QUOTE) {
- --i;
- }
- return lastIndex - i;
- }
-
/**
* Whether or not all of the user typed chars are upper case
* @return true if all user typed chars are upper case, false otherwise