From 5c90ea030ae4a944a241b6533896543ec363c1ba Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Fri, 22 Oct 1999 00:41:21 +0000 Subject: [PATCH] [ICU-7] remove :: for icu_mem...() (and remove unnecessary icu_memset()) X-Commit-URL: https://ssl.icu-project.org/trac/changeset/99 --- icu4c/source/i18n/sortkey.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/icu4c/source/i18n/sortkey.cpp b/icu4c/source/i18n/sortkey.cpp index c7cb0b944b8..80183274840 100644 --- a/icu4c/source/i18n/sortkey.cpp +++ b/icu4c/source/i18n/sortkey.cpp @@ -63,8 +63,7 @@ CollationKey::CollationKey(const uint8_t* newValues, int32_t count) return; } - ::icu_memset(fBytes, 0, fCount); - ::icu_memcpy(fBytes, newValues, fCount); + icu_memcpy(fBytes, newValues, fCount); } CollationKey::CollationKey(const UnicodeString& value) @@ -90,8 +89,10 @@ CollationKey::CollationKey(const CollationKey& other) return; } - ::icu_memset(fBytes, 0, fCapacity); - ::icu_memcpy(fBytes, other.fBytes, other.fCount); + icu_memcpy(fBytes, other.fBytes, other.fCount); + if(fCapacity>fCount) { + icu_memset(fBytes+fCount, 0, fCapacity-fCount); + } } CollationKey::~CollationKey() @@ -129,7 +130,7 @@ CollationKey::operator==(const CollationKey& source) const { return (this->fCount == source.fCount && (this->fBytes == source.fBytes || - ::icu_memcmp(this->fBytes, source.fBytes, this->fCount) == 0)); + icu_memcmp(this->fBytes, source.fBytes, this->fCount) == 0)); } const CollationKey& @@ -152,7 +153,7 @@ CollationKey::operator=(const CollationKey& other) } fHashCode = other.fHashCode; - ::icu_memcpy(fBytes, other.fBytes, fCount); + icu_memcpy(fBytes, other.fBytes, fCount); } else { @@ -190,7 +191,7 @@ CollationKey::compareTo(const CollationKey& target) const return Collator::EQUAL; } - int result = ::icu_memcmp(this->fBytes, target.fBytes, count); + int result = icu_memcmp(this->fBytes, target.fBytes, count); if (result < 0) { @@ -219,7 +220,7 @@ CollationKey::ensureCapacity(int32_t newSize) return setToBogus(); } - ::icu_memset(fBytes, 0, fCapacity); + icu_memset(fBytes, 0, fCapacity); fCapacity = newSize; } @@ -299,8 +300,7 @@ CollationKey::toByteArray(int32_t& count) const else { count = fCount; - ::icu_memset(result, 0, fCount); - ::icu_memcpy(result, fBytes, fCount); + icu_memcpy(result, fBytes, fCount); } return result;