summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-09-12 11:57:49 +0200
committerGitHub <noreply@github.com>2017-09-12 11:57:49 +0200
commitcf941fdc357791a93bd9ab9eaf16898e0c218ff3 (patch)
tree546d046bffd826359c85240ae4562ef5df734e86 /core
parent84ccda4e1d6f9a63b689167887f7d329cdc5dffa (diff)
parent8230bf0a2f39f0849b670d26067207c45edcca1a (diff)
Merge pull request #11026 from hpvb/fix-assign-in-if
Remove assignment and declarations in if statements
Diffstat (limited to 'core')
-rw-r--r--core/map.h3
-rw-r--r--core/set.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/core/map.h b/core/map.h
index 75a38a3440..a37d898a9c 100644
--- a/core/map.h
+++ b/core/map.h
@@ -453,8 +453,9 @@ private:
if (!rp)
rp = _data._nil;
Element *node = (rp->left == _data._nil) ? rp->right : rp->left;
+ node->parent = rp->parent;
- if (_data._root == (node->parent = rp->parent)) {
+ if (_data._root == node->parent) {
_data._root->left = node;
} else {
if (rp == rp->parent->left) {
diff --git a/core/set.h b/core/set.h
index 317e180869..f68d78cea1 100644
--- a/core/set.h
+++ b/core/set.h
@@ -438,8 +438,9 @@ private:
if (!rp)
rp = _data._nil;
Element *node = (rp->left == _data._nil) ? rp->right : rp->left;
+ node->parent = rp->parent;
- if (_data._root == (node->parent = rp->parent)) {
+ if (_data._root == node->parent) {
_data._root->left = node;
} else {
if (rp == rp->parent->left) {