[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:
Arnaldo Carvalho de Melo 2006-12-20 14:02:05 -02:00
parent e15d528941
commit c372555a6c
1 changed files with 3 additions and 0 deletions

View File

@ -273,6 +273,9 @@ struct class *cu__find_class_by_id(const struct cu *self, const uint64_t id)
{
struct class *pos;
if (id == 0)
return NULL;
list_for_each_entry(pos, &self->classes, tag.node)
if (pos->tag.id == id)
return pos;