Index: include/core/SkTDArray.h |
diff --git a/include/core/SkTDArray.h b/include/core/SkTDArray.h |
index 4c90460b947f25809e0c21084fff7b924c3c78e1..92f297c31a63f6a2f0c927f01c2db5ac6f69215e 100644 |
--- a/include/core/SkTDArray.h |
+++ b/include/core/SkTDArray.h |
@@ -282,12 +282,12 @@ public: |
} |
// routines to treat the array like a stack |
- T* push() { return this->append(); } |
- void push(const T& elem) { *this->append() = elem; } |
- const T& top() const { return (*this)[fCount - 1]; } |
- T& top() { return (*this)[fCount - 1]; } |
- void pop(T* elem) { if (elem) *elem = (*this)[fCount - 1]; --fCount; } |
- void pop() { --fCount; } |
+ T* push() { return this->append(); } |
+ void push(const T& elem) { *this->append() = elem; } |
+ const T& top() const { return (*this)[fCount - 1]; } |
+ T& top() { return (*this)[fCount - 1]; } |
+ void pop(T* elem) { SkASSERT(fCount > 0); if (elem) *elem = (*this)[fCount - 1]; --fCount; } |
+ void pop() { SkASSERT(fCount > 0); --fCount; } |
void deleteAll() { |
T* iter = fArray; |