ICU-3931 Some more updates according to code-review comments

X-SVN-Rev: 27455
This commit is contained in:
Kirti Velankar 2010-01-30 03:46:13 +00:00
parent df36aab82d
commit 867c479b47

View file

@ -58,6 +58,9 @@ SelectFormat::~SelectFormat() {
void
SelectFormat::init(UErrorCode& status) {
if (U_FAILURE(status)) {
return;
}
parsedValuesHash = NULL;
pattern.remove();
}
@ -69,22 +72,20 @@ SelectFormat::applyPattern(const UnicodeString& newPattern, UErrorCode& status)
return;
}
this->parsedValuesHash = NULL;
this->pattern = newPattern;
enum State{ startState, keywordState, pastKeywordState, phraseState};
//Initialization
UnicodeString keyword = UnicodeString();
UnicodeString phrase = UnicodeString();
UnicodeString keyword ;
UnicodeString phrase ;
UnicodeString* ptrPhrase ;
int32_t braceCount = 0;
if (parsedValuesHash == NULL) {
parsedValuesHash = new Hashtable(TRUE, status);
parsedValuesHash = new Hashtable(TRUE, status);
if (U_FAILURE(status)) {
return;
}
delete parsedValuesHash;
this->parsedValuesHash = NULL;
parsedValuesHash = new Hashtable(TRUE, status);
if (U_FAILURE(status)) {
return;
}
//Process the state machine