aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-24 15:55:01 +0000
committerGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-24 15:55:01 +0000
commitd58a856418ba3b3ecdc5e94629c911ec0034dfb1 (patch)
tree4ed787c840ba61478dc78f302a2c157939de28ed /include/core
parent61c9b835d13e1d4225f3a04f045658f62c702294 (diff)
Have SkTArray state that it default-initializes.
The current comments in SkTArray lead one to believe that it is default constructing all types. However, it is not calling the default constructor for primitive types, it is actually default-initializing. R=bsalomon@google.com Review URL: https://codereview.chromium.org/208393006 git-svn-id: http://skia.googlecode.com/svn/trunk@13909 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkTArray.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/core/SkTArray.h b/include/core/SkTArray.h
index 31bcabae18..6c76c78094 100644
--- a/include/core/SkTArray.h
+++ b/include/core/SkTArray.h
@@ -53,7 +53,7 @@ template <typename T, bool MEM_COPY> void* operator new(size_t, SkTArray<T, MEM_
/** When MEM_COPY is true T will be bit copied when moved.
When MEM_COPY is false, T will be copy constructed / destructed.
- In all cases T's constructor will be called on allocation,
+ In all cases T will be default-initialized on allocation,
and its destructor will be called from this object's destructor.
*/
template <typename T, bool MEM_COPY> class SkTArray {
@@ -173,7 +173,7 @@ public:
bool empty() const { return !fCount; }
/**
- * Adds 1 new default-constructed T value and returns in by reference. Note
+ * Adds 1 new default-initialized T value and returns it by reference. Note
* the reference only remains valid until the next call that adds or removes
* elements.
*/
@@ -193,9 +193,9 @@ public:
}
/**
- * Allocates n more default T values, and returns the address of the start
- * of that new range. Note: this address is only valid until the next API
- * call made on the array that might add or remove elements.
+ * Allocates n more default-initialized T values, and returns the address of
+ * the start of that new range. Note: this address is only valid until the
+ * next API call made on the array that might add or remove elements.
*/
T* push_back_n(int n) {
SkASSERT(n >= 0);