]> granicus.if.org Git - icu/commitdiff
ICU-21179 Remove unused code in Java break engines
authorCraig Cornelius <cwcornelius@gmail.com>
Thu, 25 Feb 2021 22:51:55 +0000 (22:51 +0000)
committerCraig Cornelius <cwcornelius@gmail.com>
Fri, 26 Feb 2021 23:29:26 +0000 (15:29 -0800)
See #1604

icu4j/main/classes/core/src/com/ibm/icu/text/BurmeseBreakEngine.java
icu4j/main/classes/core/src/com/ibm/icu/text/KhmerBreakEngine.java
icu4j/main/classes/core/src/com/ibm/icu/text/LaoBreakEngine.java
icu4j/main/classes/core/src/com/ibm/icu/text/ThaiBreakEngine.java

index 1119ceed404714ee6c9898b833337f2189285700..fe3d4f9f813d802fbe4b758ef023d3ed08c00237 100644 (file)
@@ -120,13 +120,9 @@ class BurmeseBreakEngine extends DictionaryBreakEngine {
                 // If we're already at the end of the range, we're done
                 if (fIter.getIndex() < rangeEnd) {
                     do {
-                        int wordsMatched = 1;
                         if (words[(wordsFound+1)%BURMESE_LOOKAHEAD].candidates(fIter, fDictionary, rangeEnd) > 0) {
-                            if (wordsMatched < 2) {
-                                // Followed by another dictionary word; mark first word as a good candidate
-                                words[wordsFound%BURMESE_LOOKAHEAD].markCurrent();
-                                wordsMatched = 2;
-                            }
+                            // Followed by another dictionary word; mark first word as a good candidate
+                            words[wordsFound%BURMESE_LOOKAHEAD].markCurrent();
 
                             // If we're already at the end of the range, we're done
                             if (fIter.getIndex() >= rangeEnd) {
index 53b6872fbb20643fe9f765db2fe053e6c01e9b93..b593c495b155dc42e9848254c363dd80ca23cbaf 100644 (file)
@@ -124,13 +124,9 @@ class KhmerBreakEngine extends DictionaryBreakEngine {
                 // If we're already at the end of the range, we're done
                 if (fIter.getIndex() < rangeEnd) {
                     do {
-                        int wordsMatched = 1;
                         if (words[(wordsFound+1)%KHMER_LOOKAHEAD].candidates(fIter, fDictionary, rangeEnd) > 0) {
-                            if (wordsMatched < 2) {
-                                // Followed by another dictionary word; mark first word as a good candidate
-                                words[wordsFound%KHMER_LOOKAHEAD].markCurrent();
-                                wordsMatched = 2;
-                            }
+                            // Followed by another dictionary word; mark first word as a good candidate
+                            words[wordsFound%KHMER_LOOKAHEAD].markCurrent();
 
                             // If we're already at the end of the range, we're done
                             if (fIter.getIndex() >= rangeEnd) {
index 73d6a03ee39267f5930274e97a1787458debb966..ec1476026fe18a46871d2507fa2d53d9e3e3479e 100644 (file)
@@ -123,13 +123,9 @@ class LaoBreakEngine extends DictionaryBreakEngine {
                 // If we're already at the end of the range, we're done
                 if (fIter.getIndex() < rangeEnd) {
                     do {
-                        int wordsMatched = 1;
                         if (words[(wordsFound+1)%LAO_LOOKAHEAD].candidates(fIter, fDictionary, rangeEnd) > 0) {
-                            if (wordsMatched < 2) {
-                                // Followed by another dictionary word; mark first word as a good candidate
-                                words[wordsFound%LAO_LOOKAHEAD].markCurrent();
-                                wordsMatched = 2;
-                            }
+                            // Followed by another dictionary word; mark first word as a good candidate
+                            words[wordsFound%LAO_LOOKAHEAD].markCurrent();
 
                             // If we're already at the end of the range, we're done
                             if (fIter.getIndex() >= rangeEnd) {
index 89407397e0931c539172e7599d7de3f0c9d7d44d..c1579d6532e377016ddb5f529c2706276546608f 100644 (file)
@@ -134,13 +134,9 @@ class ThaiBreakEngine extends DictionaryBreakEngine {
                 if (fIter.getIndex() < rangeEnd) {
                   foundBest:
                     do {
-                        int wordsMatched = 1;
                         if (words[(wordsFound+1)%THAI_LOOKAHEAD].candidates(fIter, fDictionary, rangeEnd) > 0) {
-                            if (wordsMatched < 2) {
-                                // Followed by another dictionary word; mark first word as a good candidate
-                                words[wordsFound%THAI_LOOKAHEAD].markCurrent();
-                                wordsMatched = 2;
-                            }
+                            // Followed by another dictionary word; mark first word as a good candidate
+                            words[wordsFound%THAI_LOOKAHEAD].markCurrent();
 
                             // If we're already at the end of the range, we're done
                             if (fIter.getIndex() >= rangeEnd) {