1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-07-03 00:32:00 +03:00

eeshow/kicad/delta.c (comp_eq_objs): move object comparison to comp_eq_obj

We use "return" quite a lot, which isn't what one would want in that loop.
This commit is contained in:
Werner Almesberger 2016-08-20 22:34:07 -03:00
parent c12f5f34a6
commit 54afbf5b68

View File

@ -36,15 +36,10 @@
/* ----- Components -------------------------------------------------------- */
static bool comp_eq_objs(const struct lib_obj *a, const struct lib_obj *b)
static bool comp_eq_obj(const struct lib_obj *a, const struct lib_obj *b)
{
int i;
/*
* @@@ over-simplify a little. We don't search to find objects that
* have merely been reordered.
*/
while (a && b) {
if (a->type != b->type)
return 0;
if (a->unit != b->unit || a->convert != b->convert)
@ -104,6 +99,18 @@ static bool comp_eq_objs(const struct lib_obj *a, const struct lib_obj *b)
default:
abort();
}
}
static bool comp_eq_objs(const struct lib_obj *a, const struct lib_obj *b)
{
/*
* @@@ over-simplify a little. We don't search to find objects that
* have merely been reordered.
*/
while (a && b) {
if (!comp_eq_obj(a, b))
return 0;
a = a->next;
b = b->next;
}