[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tyndur-devel] [PATCH 1/3] lib: unnötigen Aufruf von to_tree_item entfernt
* lib/collection/tree.c: subst wird nach der Initialisierung mit
to_tree_item direkt wieder überschrieben. Da to_tree_item keine
sonstigen Auswirkungen hat, können wir uns den Aufruf hier sparen.
Reported-by: Clang 3.0
Signed-off-by: Andreas Freimuth <m.nemo@xxxxxxx>
---
src/lib/collections/tree.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/lib/collections/tree.c b/src/lib/collections/tree.c
index 6bb3c63..cbb1b63 100644
--- a/src/lib/collections/tree.c
+++ b/src/lib/collections/tree.c
@@ -400,7 +400,7 @@ void* tree_remove(tree_t* tree, void* node)
// Knoten als Ersatz fuer den geloeschten. Ein guter Kandidat dafuer ist
// der am weitesten rechts gelegene Knoten des linken Teilbaums.
- struct tree_item* subst = to_tree_item(tree, node);
+ struct tree_item* subst;
struct tree_item** psubst;
subst = item->left;
@@ -470,7 +470,7 @@ void* tree_remove(tree_t* tree, void* node)
void* tree_prev(tree_t* tree, void* node)
{
struct tree_item* current = to_tree_item(tree, node);
- struct tree_item* old = current;
+ struct tree_item* old;
if (node == NULL) {
current = tree->root;
@@ -517,7 +517,7 @@ void* tree_prev(tree_t* tree, void* node)
void* tree_next(tree_t* tree, void* node)
{
struct tree_item* current = to_tree_item(tree, node);
- struct tree_item* old = current;
+ struct tree_item* old;
if (node == NULL) {
current = tree->root;
--
1.7.11.7