]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/uniset.cpp
ICU-531.48.tar.gz
[apple/icu.git] / icuSources / common / uniset.cpp
index f1b3e31a20cbea7ae9a61149ce8a8f3505116580..676c855d1f0f8a649b36f7199e441a4bdab3d027 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-*   Copyright (C) 1999-2011, International Business Machines
+*   Copyright (C) 1999-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 *   Date        Name        Description
@@ -2234,10 +2234,7 @@ int32_t UnicodeSet::spanUTF8(const char *s, int32_t length, USetSpanCondition sp
     UChar32 c;
     int32_t start=0, prev=0;
     do {
-        U8_NEXT(s, start, length, c);
-        if(c<0) {
-            c=0xfffd;
-        }
+        U8_NEXT_OR_FFFD(s, start, length, c);
         if(spanCondition!=contains(c)) {
             break;
         }
@@ -2275,10 +2272,7 @@ int32_t UnicodeSet::spanBackUTF8(const char *s, int32_t length, USetSpanConditio
     UChar32 c;
     int32_t prev=length;
     do {
-        U8_PREV(s, 0, length, c);
-        if(c<0) {
-            c=0xfffd;
-        }
+        U8_PREV_OR_FFFD(s, 0, length, c);
         if(spanCondition!=contains(c)) {
             break;
         }