Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: include/core/SkTDArray.h

Issue 16203002: add != operator for SkTDArray (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698