Add a default constructor to DecimalFormatSymbols.
Android's JNI always overwrites the entire contents of the native
DecimalFormatSymbols objects it creates, and we can save a
significant amount of time if we can tell ICU we don't care what
values the object has.
diff --git a/i18n/dcfmtsym.cpp b/i18n/dcfmtsym.cpp
index fa44fa3..d7b9839 100644
--- a/i18n/dcfmtsym.cpp
+++ b/i18n/dcfmtsym.cpp
@@ -70,6 +70,15 @@
initialize(locale, status);
}
+// BEGIN android-added: we need a default constructor for performance.
+// -------------------------------------
+
+DecimalFormatSymbols::DecimalFormatSymbols()
+{
+ initialize();
+}
+// END android-added
+
// -------------------------------------
DecimalFormatSymbols::~DecimalFormatSymbols()
diff --git a/i18n/unicode/dcfmtsym.h b/i18n/unicode/dcfmtsym.h
index 513ad30..7804799 100644
--- a/i18n/unicode/dcfmtsym.h
+++ b/i18n/unicode/dcfmtsym.h
@@ -162,6 +162,11 @@
*/
DecimalFormatSymbols( UErrorCode& status);
+ // BEGIN android-added: we need a default constructor for performance.
+ // Proposed for ICU 4.8: http://icu-project.org/trac/ticket/7392
+ DecimalFormatSymbols();
+ // END android-added
+
/**
* Copy constructor.
* @stable ICU 2.0
@@ -281,7 +286,9 @@
static UClassID U_EXPORT2 getStaticClassID();
private:
- DecimalFormatSymbols(); // default constructor not implemented
+ // BEGIN android-removed: we need a default constructor for performance.
+ // DecimalFormatSymbols(); // default constructor not implemented
+ // END android-removed
/**
* Initializes the symbols from the LocaleElements resource bundle.