From: Nikolai W. <no...@bi...> - 2011-09-09 12:28:12
|
This pattern is repeated a couple of times in glib2 and gtk2: for (i = 0; i < gargc; i++) { if (TYPE(RARRAY_PTR(argary)[i]) == T_STRING) { gargv[i+1] = RVAL2CSTR(RARRAY_PTR(argary)[i]); } else { gargv[i+1] = g_strdup(""); } } The TYPE() == T_STRING test seems like a poor choice. Shouldn’t we at least try using #to_str? Also, as this pattern is repeated I really think that we should have a utility function for it. I’ll write it, but I need input on the TYPE() comparison above. |