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

Unified Diff: src/core/SkTDynamicHash.h

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkTDPQueue.h ('k') | src/core/SkTLList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTDynamicHash.h
diff --git a/src/core/SkTDynamicHash.h b/src/core/SkTDynamicHash.h
index 8def89b9ca8107f04aef4ac093357df692d8adce..2fa37b54f741a2c876f6bba7baa8b379bb70975f 100644
--- a/src/core/SkTDynamicHash.h
+++ b/src/core/SkTDynamicHash.h
@@ -22,7 +22,7 @@ template <typename T,
int kGrowPercent = 75> // Larger -> more memory efficient, but slower.
class SkTDynamicHash {
public:
- SkTDynamicHash() : fCount(0), fDeleted(0), fCapacity(0), fArray(NULL) {
+ SkTDynamicHash() : fCount(0), fDeleted(0), fCapacity(0), fArray(nullptr) {
SkASSERT(this->validate());
}
@@ -86,14 +86,14 @@ public:
int count() const { return fCount; }
- // Return the entry with this key if we have it, otherwise NULL.
+ // Return the entry with this key if we have it, otherwise nullptr.
T* find(const Key& key) const {
int index = this->firstIndex(key);
for (int round = 0; round < fCapacity; round++) {
SkASSERT(index >= 0 && index < fCapacity);
T* candidate = fArray[index];
if (Empty() == candidate) {
- return NULL;
+ return nullptr;
}
if (Deleted() != candidate && GetKey(*candidate) == key) {
return candidate;
@@ -101,12 +101,12 @@ public:
index = this->nextIndex(index, round);
}
SkASSERT(fCapacity == 0);
- return NULL;
+ return nullptr;
}
// Add an entry with this key. We require that no entry with newEntry's key is already present.
void add(T* newEntry) {
- SkASSERT(NULL == this->find(GetKey(*newEntry)));
+ SkASSERT(nullptr == this->find(GetKey(*newEntry)));
this->maybeGrow();
this->innerAdd(newEntry);
SkASSERT(this->validate());
@@ -132,7 +132,7 @@ public:
fDeleted = 0;
fCapacity = 0;
sk_free(fArray);
- fArray = NULL;
+ fArray = nullptr;
}
protected:
@@ -157,7 +157,7 @@ protected:
private:
// We have two special values to indicate an empty or deleted entry.
- static T* Empty() { return reinterpret_cast<T*>(0); } // i.e. NULL
+ static T* Empty() { return reinterpret_cast<T*>(0); } // i.e. nullptr
static T* Deleted() { return reinterpret_cast<T*>(1); } // Also an invalid pointer.
bool validate() const {
« no previous file with comments | « src/core/SkTDPQueue.h ('k') | src/core/SkTLList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698