OLD | NEW |
1 /* | 1 /* |
2 ****************************************************************************** | 2 ****************************************************************************** |
3 * Copyright (C) 1999-2010, International Business Machines Corporation and * | 3 * Copyright (C) 1999-2015, International Business Machines Corporation and |
4 * others. All Rights Reserved. * | 4 * others. All Rights Reserved. |
5 ****************************************************************************** | 5 ****************************************************************************** |
6 * Date Name Description | 6 * Date Name Description |
7 * 10/22/99 alan Creation. | 7 * 10/22/99 alan Creation. |
8 ********************************************************************** | 8 ********************************************************************** |
9 */ | 9 */ |
10 | 10 |
11 #include "uvectr32.h" | 11 #include "uvectr32.h" |
12 #include "cmemory.h" | 12 #include "cmemory.h" |
13 #include "putilimp.h" | 13 #include "putilimp.h" |
14 | 14 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 for (i=startIndex; i<count; ++i) { | 189 for (i=startIndex; i<count; ++i) { |
190 if (key == elements[i]) { | 190 if (key == elements[i]) { |
191 return i; | 191 return i; |
192 } | 192 } |
193 } | 193 } |
194 return -1; | 194 return -1; |
195 } | 195 } |
196 | 196 |
197 | 197 |
198 UBool UVector32::expandCapacity(int32_t minimumCapacity, UErrorCode &status) { | 198 UBool UVector32::expandCapacity(int32_t minimumCapacity, UErrorCode &status) { |
| 199 if (U_FAILURE(status)) { |
| 200 return FALSE; |
| 201 } |
199 if (minimumCapacity < 0) { | 202 if (minimumCapacity < 0) { |
200 status = U_ILLEGAL_ARGUMENT_ERROR; | 203 status = U_ILLEGAL_ARGUMENT_ERROR; |
201 return FALSE; | 204 return FALSE; |
202 } | 205 } |
203 if (capacity >= minimumCapacity) { | 206 if (capacity >= minimumCapacity) { |
204 return TRUE; | 207 return TRUE; |
205 } | 208 } |
206 if (maxCapacity>0 && minimumCapacity>maxCapacity) { | 209 if (maxCapacity>0 && minimumCapacity>maxCapacity) { |
207 status = U_BUFFER_OVERFLOW_ERROR; | 210 status = U_BUFFER_OVERFLOW_ERROR; |
208 return FALSE; | 211 return FALSE; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 ++count; | 324 ++count; |
322 } | 325 } |
323 } | 326 } |
324 | 327 |
325 | 328 |
326 | 329 |
327 | 330 |
328 | 331 |
329 U_NAMESPACE_END | 332 U_NAMESPACE_END |
330 | 333 |
OLD | NEW |