diff options
author | Henry Wilson <m3henry@googlemail.com> | 2019-04-10 22:07:06 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-04-10 23:22:20 +0200 |
commit | 7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch) | |
tree | 99f134b7e66367cf11e10bc5061896eab4a3264f /src/core/kdtree.hpp | |
parent | 3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff) | |
download | openttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz |
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/core/kdtree.hpp')
-rw-r--r-- | src/core/kdtree.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/kdtree.hpp b/src/core/kdtree.hpp index 154f27fc5..c7f66ebff 100644 --- a/src/core/kdtree.hpp +++ b/src/core/kdtree.hpp @@ -108,11 +108,11 @@ class Kdtree { std::vector<T> elements = this->FreeSubtree(this->root); elements.push_back(root_element); - if (include_element != NULL) { + if (include_element != nullptr) { elements.push_back(*include_element); initial_count++; } - if (exclude_element != NULL) { + if (exclude_element != nullptr) { typename std::vector<T>::iterator removed = std::remove(elements.begin(), elements.end(), *exclude_element); elements.erase(removed, elements.end()); initial_count--; @@ -377,7 +377,7 @@ public: */ void Rebuild() { - this->Rebuild(NULL, NULL); + this->Rebuild(nullptr, nullptr); } /** @@ -390,7 +390,7 @@ public: if (this->Count() == 0) { this->root = this->AddNode(element); } else { - if (!this->IsUnbalanced() || !this->Rebuild(&element, NULL)) { + if (!this->IsUnbalanced() || !this->Rebuild(&element, nullptr)) { this->InsertRecursive(element, this->root, 0); this->IncrementUnbalanced(); } @@ -408,7 +408,7 @@ public: { size_t count = this->Count(); if (count == 0) return; - if (!this->IsUnbalanced() || !this->Rebuild(NULL, &element)) { + if (!this->IsUnbalanced() || !this->Rebuild(nullptr, &element)) { /* If the removed element is the root node, this modifies this->root */ this->root = this->RemoveRecursive(element, this->root, 0); this->IncrementUnbalanced(); |