From a655430837b7e4dc4286a5c324ca5369ce0e9b63 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Fri, 8 Jun 2012 21:31:22 +0000 Subject: [PATCH] ICU-8773 use real array element comparison, not memcmp() X-SVN-Rev: 31926 --- icu4c/source/common/messagepattern.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/icu4c/source/common/messagepattern.cpp b/icu4c/source/common/messagepattern.cpp index ed6ee252a66..1f0beba91d0 100644 --- a/icu4c/source/common/messagepattern.cpp +++ b/icu4c/source/common/messagepattern.cpp @@ -93,8 +93,11 @@ public: int32_t length, UErrorCode &errorCode); UBool ensureCapacityForOneMore(int32_t oldLength, UErrorCode &errorCode); - UBool memEquals(const MessagePatternList &other, int32_t length) const { - return 0==uprv_memcmp(a.getAlias(), other.a.getAlias(), length*sizeof(T)); + UBool equals(const MessagePatternList &other, int32_t length) const { + for(int32_t i=0; i a; @@ -314,7 +317,7 @@ MessagePattern::operator==(const MessagePattern &other) const { msg==other.msg && // parts.equals(o.parts) partsLength==other.partsLength && - (partsLength==0 || partsList->memEquals(*other.partsList, partsLength)); + (partsLength==0 || partsList->equals(*other.partsList, partsLength)); // No need to compare numericValues if msg and parts are the same. }