From 8230bf0a2f39f0849b670d26067207c45edcca1a Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Wed, 6 Sep 2017 23:50:18 +0200 Subject: Remove assignment and declarations in if statements After discussing with @reduz and @akien-mga it was decided that we do not allow assignments or declarations in if statements. This PR removes the instances of this I could find by automated means. --- core/map.h | 3 ++- core/set.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'core') 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) { -- cgit v1.2.3