[redland-dev] C# cleanup

Edd Dumbill edd at usefulinc.com
Wed Jul 14 15:14:05 BST 2004


On Wed, 2004-07-14 at 14:48 +0100, Dave Beckett wrote:
> 
> C# stylistically you did
> 
> -                       else if ((Object)uri == null)
> +                       if (uri == (Uri) null)
> 
> which I probably do both ways elsewhere.  The reason I cast both of
> them to null was to prevent a Uri.Equals method being called with a
> null object (raises an exception) or a null parameter.  It seemed
> easier to cast to Object and let Object.Equals(null, null) deal with
> it.  Maybe?

Hmm, if this really was a problem then the constructor for Query would
fail in your test.cs, which it doesn't.  In fact we don't need the (Uri)
cast at all.  if (uri == null) will compile just fine.

So that change (removal of the cast) can be made in Parser.cs and Query.
cs.


-- Edd





More information about the redland-dev mailing list