]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/uvectr32.h
ICU-491.11.1.tar.gz
[apple/icu.git] / icuSources / common / uvectr32.h
index ff49d49902f7ce77adb17df9a8a503b884ef92a1..d03eba62d00275d37223e60851a7d9e2d50d001d 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-*   Copyright (C) 1999-2010, International Business Machines
+*   Copyright (C) 1999-2011, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 */
@@ -219,7 +219,7 @@ inline UBool UVector32::ensureCapacity(int32_t minimumCapacity, UErrorCode &stat
 }
 
 inline int32_t UVector32::elementAti(int32_t index) const {
-    return (0 <= index && index < count) ? elements[index] : 0;
+    return (index >= 0 && count > 0 && count - index > 0) ? elements[index] : 0;
 }