[CLASSES]: Return NULL in cu__find_class_by_id if tag.type == 0
I.e. if the type is void, avoiding looking the whole list for something that is not there. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
parent
e15d528941
commit
c372555a6c
|
@ -273,6 +273,9 @@ struct class *cu__find_class_by_id(const struct cu *self, const uint64_t id)
|
||||||
{
|
{
|
||||||
struct class *pos;
|
struct class *pos;
|
||||||
|
|
||||||
|
if (id == 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
list_for_each_entry(pos, &self->classes, tag.node)
|
list_for_each_entry(pos, &self->classes, tag.node)
|
||||||
if (pos->tag.id == id)
|
if (pos->tag.id == id)
|
||||||
return pos;
|
return pos;
|
||||||
|
|
Loading…
Reference in New Issue