Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 867847a

Browse files
committed
make bkb.c closer to original article and also less suspitios to clang analyzer
1 parent 8d27a60 commit 867847a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/bkb.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ static void findMaximumIndependentSet(NodeList* cur, NodeList* result, nodemask_
4848
int cnt = 0;
4949
int pos = -1;
5050

51-
for (j = ne; j < ce; j++) {
51+
for (j = ne; j < ce && cnt < minnod; j++)
52+
{
5253
if (BIT_CHECK(graph[p], oldSet[j])) {
53-
if (++cnt == minnod) {
54-
break;
55-
}
54+
cnt++;
5655
pos = j;
5756
}
5857
}
@@ -70,6 +69,9 @@ static void findMaximumIndependentSet(NodeList* cur, NodeList* result, nodemask_
7069

7170

7271
for (k = minnod + nod; k >= 1; k--) {
72+
73+
Assert(s >= 0);
74+
7375
sel = oldSet[s];
7476
oldSet[s] = oldSet[ne];
7577
oldSet[ne] = sel;

0 commit comments

Comments
 (0)