OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkTDArray_DEFINED | 10 #ifndef SkTDArray_DEFINED |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 } | 63 } |
64 return *this; | 64 return *this; |
65 } | 65 } |
66 | 66 |
67 friend bool operator==(const SkTDArray<T>& a, const SkTDArray<T>& b) { | 67 friend bool operator==(const SkTDArray<T>& a, const SkTDArray<T>& b) { |
68 return a.fCount == b.fCount && | 68 return a.fCount == b.fCount && |
69 (a.fCount == 0 || | 69 (a.fCount == 0 || |
70 !memcmp(a.fArray, b.fArray, a.fCount * sizeof(T))); | 70 !memcmp(a.fArray, b.fArray, a.fCount * sizeof(T))); |
71 } | 71 } |
| 72 friend bool operator!=(const SkTDArray<T>& a, const SkTDArray<T>& b) { |
| 73 return !(a == b); |
| 74 } |
72 | 75 |
73 void swap(SkTDArray<T>& other) { | 76 void swap(SkTDArray<T>& other) { |
74 SkTSwap(fArray, other.fArray); | 77 SkTSwap(fArray, other.fArray); |
75 #ifdef SK_DEBUG | 78 #ifdef SK_DEBUG |
76 SkTSwap(fData, other.fData); | 79 SkTSwap(fData, other.fData); |
77 #endif | 80 #endif |
78 SkTSwap(fReserve, other.fReserve); | 81 SkTSwap(fReserve, other.fReserve); |
79 SkTSwap(fCount, other.fCount); | 82 SkTSwap(fCount, other.fCount); |
80 } | 83 } |
81 | 84 |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 #ifdef SK_DEBUG | 359 #ifdef SK_DEBUG |
357 fData = (ArrayT*)fArray; | 360 fData = (ArrayT*)fArray; |
358 #endif | 361 #endif |
359 fReserve = size; | 362 fReserve = size; |
360 } | 363 } |
361 fCount += extra; | 364 fCount += extra; |
362 } | 365 } |
363 }; | 366 }; |
364 | 367 |
365 #endif | 368 #endif |
OLD | NEW |