summaryrefslogtreecommitdiff
path: root/core/map.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/map.h')
-rw-r--r--core/map.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/core/map.h b/core/map.h
index 010c47b0fb..6b9dff51de 100644
--- a/core/map.h
+++ b/core/map.h
@@ -95,11 +95,11 @@ public:
};
Element() {
color = RED;
- right = NULL;
- left = NULL;
- parent = NULL;
- _next = NULL;
- _prev = NULL;
+ right = nullptr;
+ left = nullptr;
+ parent = nullptr;
+ _next = nullptr;
+ _prev = nullptr;
};
};
@@ -118,7 +118,7 @@ private:
#else
_nil = (Element *)&_GlobalNilClass::_nil;
#endif
- _root = NULL;
+ _root = nullptr;
size_cache = 0;
}
@@ -133,7 +133,7 @@ private:
if (_root) {
memdelete_allocator<Element, A>(_root);
- _root = NULL;
+ _root = nullptr;
}
}
@@ -205,7 +205,7 @@ private:
}
if (node->parent == _data._root)
- return NULL; // No successor, as p_node = last node
+ return nullptr; // No successor, as p_node = last node
return node->parent;
}
}
@@ -227,7 +227,7 @@ private:
}
if (node == _data._root)
- return NULL; // No predecessor, as p_node = first node
+ return nullptr; // No predecessor, as p_node = first node
return node->parent;
}
}
@@ -246,13 +246,13 @@ private:
return node; // found
}
- return NULL;
+ return nullptr;
}
Element *_find_closest(const K &p_key) const {
Element *node = _data._root->left;
- Element *prev = NULL;
+ Element *prev = nullptr;
C less;
while (node != _data._nil) {
@@ -266,8 +266,8 @@ private:
return node; // found
}
- if (prev == NULL)
- return NULL; // tree empty
+ if (prev == nullptr)
+ return nullptr; // tree empty
if (less(p_key, prev->_key))
prev = prev->_prev;
@@ -519,7 +519,7 @@ public:
const Element *find(const K &p_key) const {
if (!_data._root)
- return NULL;
+ return nullptr;
const Element *res = _find(p_key);
return res;
@@ -528,7 +528,7 @@ public:
Element *find(const K &p_key) {
if (!_data._root)
- return NULL;
+ return nullptr;
Element *res = _find(p_key);
return res;
@@ -537,7 +537,7 @@ public:
const Element *find_closest(const K &p_key) const {
if (!_data._root)
- return NULL;
+ return nullptr;
const Element *res = _find_closest(p_key);
return res;
@@ -546,7 +546,7 @@ public:
Element *find_closest(const K &p_key) {
if (!_data._root)
- return NULL;
+ return nullptr;
Element *res = _find_closest(p_key);
return res;
@@ -554,7 +554,7 @@ public:
bool has(const K &p_key) const {
- return find(p_key) != NULL;
+ return find(p_key) != nullptr;
}
Element *insert(const K &p_key, const V &p_value) {
@@ -612,11 +612,11 @@ public:
Element *front() const {
if (!_data._root)
- return NULL;
+ return nullptr;
Element *e = _data._root->left;
if (e == _data._nil)
- return NULL;
+ return nullptr;
while (e->left != _data._nil)
e = e->left;
@@ -627,11 +627,11 @@ public:
Element *back() const {
if (!_data._root)
- return NULL;
+ return nullptr;
Element *e = _data._root->left;
if (e == _data._nil)
- return NULL;
+ return nullptr;
while (e->right != _data._nil)
e = e->right;