[Libosinfo] [PATCH 1/2] test-isodetect: replace while loop with for loop

Fabiano Fidêncio fidencio at redhat.com
Wed Oct 17 19:10:06 UTC 2018


On Wed, Oct 17, 2018 at 8:08 PM Věra Cholasta <vbudikov at redhat.com> wrote:
>
> ---
>  tests/test-isodetect.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c
> index 76f0c5a..c1833ae 100644
> --- a/tests/test-isodetect.c
> +++ b/tests/test-isodetect.c
> @@ -390,8 +390,7 @@ static void test_one(const gchar *vendor)
>
>      g_assert_nonnull(isos);
>
> -    tmp = isos;
> -    while (tmp) {
> +    for (tmp = isos; tmp; tmp = tmp->next) {
>          struct ISOInfo *info  = tmp->data;
>          gboolean matched = osinfo_db_identify_media(db, info->media);
>          OsinfoOs *os;
> @@ -408,8 +407,6 @@ static void test_one(const gchar *vendor)
>          g_assert_cmpstr(shortid, ==, info->shortid);
>          g_object_unref(G_OBJECT(os));
>          test_langs(info);
> -
> -        tmp = tmp->next;
>      }
>
>      g_list_foreach(isos, (GFunc)free_iso, NULL);
> --
> 1.8.3.1
>
> _______________________________________________
> Libosinfo mailing list
> Libosinfo at redhat.com
> https://www.redhat.com/mailman/listinfo/libosinfo

Reviewed-by: Fabiano Fidêncio <fidencio at redhat.com>




More information about the Libosinfo mailing list