Skip to content

Commit 5f97376

Browse files
committed
Fixed tree_navigation - assume root cannot be first parent
1 parent a5bc556 commit 5f97376

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

project_demos/src/tree_navigation.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,13 @@ void self_stabilizing_tree(void* parameters)
164164
if(parentNbrList.nbrs[i]->ID == rootID)
165165
{
166166
index = i;
167+
nav = FALSE;
167168
}
168169
}
169170

170171
if(size > 0)
171172
{
172173
behMoveToNbr(&behOutput, parentNbrList.nbrs[index] , MOTION_TV);
173-
if(index != 0)
174-
{
175-
nav = FALSE;
176-
}
177174
}
178175
}
179176
neighborsPutMutex();

psets/PS3-CProgramming/tree_navigation.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,13 @@ void self_stabilizing_tree(void* parameters)
164164
if(parentNbrList.nbrs[i]->ID == rootID)
165165
{
166166
index = i;
167+
nav = FALSE;
167168
}
168169
}
169170

170171
if(size > 0)
171172
{
172173
behMoveToNbr(&behOutput, parentNbrList.nbrs[index] , MOTION_TV);
173-
if(index != 0)
174-
{
175-
nav = FALSE;
176-
}
177174
}
178175
}
179176
neighborsPutMutex();

0 commit comments

Comments
 (0)