Usually, when creating list of something, count decision at first, then
generate items of the list. At last, the number of items is checked as
the same as the count. However, it's unlikely to have different number
of items.
This commit simplifies the count check.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
udev_device_unref(dev);
}
}
- if (index != count) {
- g_warn_if_reached();
- g_free(*entries);
- *entries = NULL;
- goto end;
- }
+
+ g_warn_if_fail(index == count);
+
*entry_count = count;
qsort(*entries, count, sizeof(guint), compare_guint);