Re: removal of duplicated code in gnome-vfs-uri



On 10 Mar 2003, Christophe Fergeau wrote:

> 
> > This looks fine to commit. The only change in behaviour is the replacement 
> > of g_return_val_if_fail() with normal comparisons in some edge cases (used 
> > to be in make_full_uri_from_relative). g_return_val_if_fail() prints out a 
> > warning if it fails and G_DISABLE_CHECKS is not defined. Maybe we should 
> > add that back?
> 
> I finally looked at that, the only g_return_if_fail which will disappear
> with this patch is 
> g_return_val_if_fail (uri != NULL, NULL);
> (the second one couldn't be triggered since base_uri couldn't be NULL)
> and this case will trigger an assertion in gnome_vfs_uri_new because it
> will be fed a NULL uri, so maybe that's ok to also remove that one ? 
> This case would even disappear if we unify
> gnome_vfs_uri_resolve_relative and gnome_vfs_uri_make_full_from_relative
> behaviour when relative_reference is NULL.
> 
> Any thoughts on all that ? 

Its probably fine to remove the g_return_val_if_fail and let it assert 
instead. Passing NULL is a bug anyway.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a time-tossed gay jungle king looking for a cure to the poison coursing 
through his veins. She's a plucky out-of-work former first lady who believes 
she is the reincarnation of an ancient Egyptian queen. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]