No point in doing a full strlen, we can just check the first byte.
Also, invert the conditional using `continue` to avoid another
level of indentation.
for (char **iter = lines; *iter; iter++)
{
const char *line = *iter;
- if (strlen (line) > 0)
- {
- gsize pubkey_size;
- g_autofree guchar *pubkey = g_base64_decode (line, &pubkey_size);
- ret->pubkeys = g_list_append (
- ret->pubkeys, g_bytes_new_take (g_steal_pointer (&pubkey), pubkey_size));
- }
+ if (!*line)
+ continue;
+
+ gsize pubkey_size;
+ g_autofree guchar *pubkey = g_base64_decode (line, &pubkey_size);
+ ret->pubkeys = g_list_append (
+ ret->pubkeys, g_bytes_new_take (g_steal_pointer (&pubkey), pubkey_size));
}
}