aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-11-19 09:41:27 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-19 09:41:27 -0800
commit48b411af76fac533c05852d856e8e7e33df4965f (patch)
tree18b2db4e6091b7dffc903e826f73b0886cb222e0 /include
parent54e0c12a5ab2d83fe249dd199d6879e8c0f04404 (diff)
Remove debug-only fData from SKTDArray.
It makes the code harder to read, and makes Debug and Release SkTDArrays different sizes. Looks like fData is left over from when debuggers weren't very good at inspecting data structures. No API changes. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/739263002
Diffstat (limited to 'include')
-rw-r--r--include/core/SkTDArray.h30
1 files changed, 0 insertions, 30 deletions
diff --git a/include/core/SkTDArray.h b/include/core/SkTDArray.h
index 8e8b4923e3..08478c7851 100644
--- a/include/core/SkTDArray.h
+++ b/include/core/SkTDArray.h
@@ -17,23 +17,14 @@ public:
SkTDArray() {
fReserve = fCount = 0;
fArray = NULL;
-#ifdef SK_DEBUG
- fData = NULL;
-#endif
}
SkTDArray(const T src[], int count) {
SkASSERT(src || count == 0);
fReserve = fCount = 0;
fArray = NULL;
-#ifdef SK_DEBUG
- fData = NULL;
-#endif
if (count) {
fArray = (T*)sk_malloc_throw(count * sizeof(T));
-#ifdef SK_DEBUG
- fData = (ArrayT*)fArray;
-#endif
memcpy(fArray, src, sizeof(T) * count);
fReserve = fCount = count;
}
@@ -41,9 +32,6 @@ public:
SkTDArray(const SkTDArray<T>& src) {
fReserve = fCount = 0;
fArray = NULL;
-#ifdef SK_DEBUG
- fData = NULL;
-#endif
SkTDArray<T> tmp(src.fArray, src.fCount);
this->swap(tmp);
}
@@ -75,9 +63,6 @@ public:
void swap(SkTDArray<T>& other) {
SkTSwap(fArray, other.fArray);
-#ifdef SK_DEBUG
- SkTSwap(fData, other.fData);
-#endif
SkTSwap(fReserve, other.fReserve);
SkTSwap(fCount, other.fCount);
}
@@ -89,7 +74,6 @@ public:
T* array = fArray;
fArray = NULL;
fReserve = fCount = 0;
- SkDEBUGCODE(fData = NULL;)
return array;
}
@@ -137,9 +121,6 @@ public:
if (fArray) {
sk_free(fArray);
fArray = NULL;
-#ifdef SK_DEBUG
- fData = NULL;
-#endif
fReserve = fCount = 0;
} else {
SkASSERT(fReserve == 0 && fCount == 0);
@@ -343,7 +324,6 @@ public:
SkASSERT((fReserve == 0 && fArray == NULL) ||
(fReserve > 0 && fArray != NULL));
SkASSERT(fCount <= fReserve);
- SkASSERT(fData == (ArrayT*)fArray);
}
#endif
@@ -353,13 +333,6 @@ public:
}
private:
-#ifdef SK_DEBUG
- enum {
- kDebugArraySize = 16
- };
- typedef T ArrayT[kDebugArraySize];
- ArrayT* fData;
-#endif
T* fArray;
int fReserve;
int fCount;
@@ -385,9 +358,6 @@ private:
fReserve = count + 4;
fReserve += fReserve / 4;
fArray = (T*)sk_realloc_throw(fArray, fReserve * sizeof(T));
-#ifdef SK_DEBUG
- fData = (ArrayT*)fArray;
-#endif
}
};