In Vala you can simply just check for str != "", this is enough.

No, if str is nullable it's semantically different, because str != "" will be generated as

if (g_strcmp0 (_tmp1_, "") != 0) {
  ..
}

This will be TRUE for _tmp1_ being NULL because NULL isn't "" ( and g_strcmp0 will return -1 because NULL is < everything)
so if str is nullable, str != "" means NULL or not empty.
_______________________________________________
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to