Skip to content

Commit 8bbe0c4

Browse files
committed
Remote unused test for brokeness from addedge
1 parent 6adcbee commit 8bbe0c4

1 file changed

Lines changed: 12 additions & 17 deletions

File tree

src/order.c

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,28 +102,25 @@ struct orderdata {
102102
int ncycles;
103103
};
104104

105-
static int
105+
static void
106106
addteedge(struct orderdata *od, int from, int to, int type)
107107
{
108108
int i;
109109
struct s_TransactionElement *te;
110110

111111
if (from == to)
112-
return 0;
112+
return;
113113

114114
/* printf("edge %d(%s) -> %d(%s) type %x\n", from, pool_solvid2str(pool, od->tes[from].p), to, pool_solvid2str(pool, od->tes[to].p), type); */
115115

116116
te = od->tes + from;
117117
for (i = te->edges; od->edgedata[i]; i += 2)
118118
if (od->edgedata[i] == to)
119119
break;
120-
/* test of brokenness */
121-
if (type == TYPE_BROKEN)
122-
return od->edgedata[i] && (od->edgedata[i + 1] & TYPE_BROKEN) != 0 ? 1 : 0;
123120
if (od->edgedata[i])
124121
{
125122
od->edgedata[i + 1] |= type;
126-
return 0;
123+
return;
127124
}
128125
if (i + 1 == od->nedgedata)
129126
{
@@ -145,10 +142,9 @@ addteedge(struct orderdata *od, int from, int to, int type)
145142
od->edgedata[i + 1] = type;
146143
od->edgedata[i + 2] = 0; /* end marker */
147144
od->nedgedata = i + 3;
148-
return 0;
149145
}
150146

151-
static int
147+
static void
152148
addedge(struct orderdata *od, Id from, Id to, int type)
153149
{
154150
Transaction *trans = od->trans;
@@ -166,16 +162,15 @@ addedge(struct orderdata *od, Id from, Id to, int type)
166162
from = trans->transaction_installed[from - pool->installed->start];
167163
else
168164
{
169-
int ret = 0;
170165
Queue ti;
171166
Id tibuf[5];
172167

173168
queue_init_buffer(&ti, tibuf, sizeof(tibuf)/sizeof(*tibuf));
174169
transaction_all_obs_pkgs(trans, from, &ti);
175170
for (i = 0; i < ti.count; i++)
176-
ret |= addedge(od, ti.elements[i], to, type);
171+
addedge(od, ti.elements[i], to, type);
177172
queue_free(&ti);
178-
return ret;
173+
return;
179174
}
180175
}
181176
s = pool->solvables + to;
@@ -186,16 +181,15 @@ addedge(struct orderdata *od, Id from, Id to, int type)
186181
to = trans->transaction_installed[to - pool->installed->start];
187182
else
188183
{
189-
int ret = 0;
190184
Queue ti;
191185
Id tibuf[5];
192186

193187
queue_init_buffer(&ti, tibuf, sizeof(tibuf)/sizeof(*tibuf));
194188
transaction_all_obs_pkgs(trans, to, &ti);
195189
for (i = 0; i < ti.count; i++)
196-
ret |= addedge(od, from, ti.elements[i], type);
190+
addedge(od, from, ti.elements[i], type);
197191
queue_free(&ti);
198-
return ret;
192+
return;
199193
}
200194
}
201195

@@ -204,16 +198,17 @@ addedge(struct orderdata *od, Id from, Id to, int type)
204198
if (te->p == to)
205199
break;
206200
if (i == od->ntes)
207-
return 0;
201+
return;
208202
to = i;
209203

210204
for (i = 1, te = od->tes + i; i < od->ntes; i++, te++)
211205
if (te->p == from)
212206
break;
213207
if (i == od->ntes)
214-
return 0;
208+
return;
209+
from = i;
215210

216-
return addteedge(od, i, to, type);
211+
addteedge(od, from, to, type);
217212
}
218213

219214
static inline int

0 commit comments

Comments
 (0)