From 95ab039646cbd507f8343a32b787d79ee37f1724 Mon Sep 17 00:00:00 2001 From: Alan Liu Date: Fri, 23 May 2003 20:32:33 +0000 Subject: [PATCH] ICU-2495 incorporate review changes X-SVN-Rev: 12089 --- icu4c/source/common/uniset.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/icu4c/source/common/uniset.cpp b/icu4c/source/common/uniset.cpp index 7421a5c080..4716d941fd 100644 --- a/icu4c/source/common/uniset.cpp +++ b/icu4c/source/common/uniset.cpp @@ -161,13 +161,16 @@ static Hashtable* CASE_EQUIV_HASH = NULL; // for closeOver(USET_CASE) static CompactByteArray* CASE_EQUIV_CBA = NULL; // for closeOver(USET_CASE) /** - * Keep code points in range. + * Modify the given UChar32 variable so that it is in range, by + * pinning values < UNICODESET_LOW to UNICODESET_LOW, and + * pinning values > UNICODESET_HIGH-1 to UNICODESET_HIGH-1. + * It modifies its argument in-place and also returns it. */ inline UChar32 pinCodePoint(UChar32& c) { - if (c < 0) { - c = 0; - } else if (c > 0x10FFFF) { - c = 0x10FFFF; + if (c < UNICODESET_LOW) { + c = UNICODESET_LOW; + } else if (c > (UNICODESET_HIGH-1)) { + c = (UNICODESET_HIGH-1); } return c; }