Index: include/core/SkTArray.h |
diff --git a/include/core/SkTArray.h b/include/core/SkTArray.h |
index 9d410c12ea6940dc404ee1563ec325c64d2584d7..dea0e38fecae7e2ac10e0f0b7b517c2847e06364 100644 |
--- a/include/core/SkTArray.h |
+++ b/include/core/SkTArray.h |
@@ -273,6 +273,9 @@ public: |
/** Swaps the contents of this array with that array. Does a pointer swap if possible, |
otherwise copies the T values. */ |
void swap(SkTArray* that) { |
+ if (this == that) { |
+ return; |
+ } |
if (this->fPreAllocMemArray != this->fItemArray && |
that->fPreAllocMemArray != that->fItemArray) { |
// If neither is using a preallocated array then just swap. |