From: Andy Heninger
Date: Tue, 5 Dec 2017 00:07:30 +0000 (+0000)
Subject: ICU-10688 Break Iterator type logic removal, a few minor cleanups.
X-Git-Tag: release-61-rc~63^2
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7f2cd98d3a5b8eac0e2a2fc29b212859aa749ca;p=icu
ICU-10688 Break Iterator type logic removal, a few minor cleanups.
X-SVN-Rev: 40689
---
diff --git a/icu4c/source/common/brkeng.cpp b/icu4c/source/common/brkeng.cpp
index 0455bb5cd41..7144af60b24 100644
--- a/icu4c/source/common/brkeng.cpp
+++ b/icu4c/source/common/brkeng.cpp
@@ -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);
+ }
}
/*
diff --git a/icu4c/source/common/dictbe.h b/icu4c/source/common/dictbe.h
index ed9d95e3c7f..731bfdff9f2 100644
--- a/icu4c/source/common/dictbe.h
+++ b/icu4c/source/common/dictbe.h
@@ -59,7 +59,6 @@ class DictionaryBreakEngine : public LanguageBreakEngine {
* a particular kind of break.
*
* @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 );
- /**
- * Set the break types handled by this engine.
- *
- * @param breakTypes A bitmap of types handled by the engine.
- */
-// virtual void setBreakTypes( uint32_t breakTypes );
-
/**
* Divide up a range of known dictionary characters handled by this break engine.
*