]> granicus.if.org Git - icu/commitdiff
ICU-10688 Break Iterator type logic removal, a few minor cleanups.
authorAndy Heninger <andy.heninger@gmail.com>
Tue, 5 Dec 2017 00:07:30 +0000 (00:07 +0000)
committerAndy Heninger <andy.heninger@gmail.com>
Tue, 5 Dec 2017 00:07:30 +0000 (00:07 +0000)
X-SVN-Rev: 40689

icu4c/source/common/brkeng.cpp
icu4c/source/common/dictbe.h

index 0455bb5cd41711c153b32d9235d9b7904508085d..7144af60b2406eb0aed9f6362f013b84cf7840e7 100644 (file)
@@ -88,18 +88,18 @@ UnhandledEngine::findBreaks( UText *text,
 
 void
 UnhandledEngine::handleCharacter(UChar32 c) {
+    if (fHandled == nullptr) {
+        fHandled = new UnicodeSet();
         if (fHandled == nullptr) {
-            fHandled = new UnicodeSet();
-            if (fHandled == nullptr) {
-                return;
-            }
-        }
-        if (!fHandled->contains(c)) {
-            UErrorCode status = U_ZERO_ERROR;
-            // Apply the entire script of the character.
-            int32_t script = u_getIntPropertyValue(c, UCHAR_SCRIPT);
-            fHandled->applyIntPropertyValue(UCHAR_SCRIPT, script, status);
+            return;
         }
+    }
+    if (!fHandled->contains(c)) {
+        UErrorCode status = U_ZERO_ERROR;
+        // Apply the entire script of the character.
+        int32_t script = u_getIntPropertyValue(c, UCHAR_SCRIPT);
+        fHandled->applyIntPropertyValue(UCHAR_SCRIPT, script, status);
+    }
 }
 
 /*
index ed9d95e3c7f2140bbd5f198d65f58d22d87815a7..731bfdff9f225e6f5768344dbd0d09527a0993e3 100644 (file)
@@ -59,7 +59,6 @@ class DictionaryBreakEngine : public LanguageBreakEngine {
    * a particular kind of break.</p>
    *
    * @param c A character which begins a run that the engine might handle
-   * @param breakType The type of text break which the caller wants to determine
    * @return TRUE if this engine handles the particular character and break
    * type.
    */
@@ -90,13 +89,6 @@ class DictionaryBreakEngine : public LanguageBreakEngine {
   */
   virtual void setCharacters( const UnicodeSet &set );
 
- /**
-  * <p>Set the break types handled by this engine.</p>
-  *
-  * @param breakTypes A bitmap of types handled by the engine.
-  */
-//  virtual void setBreakTypes( uint32_t breakTypes );
-
  /**
   * <p>Divide up a range of known dictionary characters handled by this break engine.</p>
   *