[Mono-list] mcs compiles on linux. Now what?

Paolo Molaro lupus@ximian.com
Sat, 9 Mar 2002 11:47:16 +0100


On 03/08/02 Martin Baulig wrote:
> > My point is that the IsValueType check should not be there.
> > First, if you really want to keep it, one is enough:
> > 
> > 	typea.IsValueType && typeb.IsValueType && typea == typeb
> > 
> > is true in all the cases that:
> > 
> > 	typea.IsValueType && typea == typeb
> 
> Good point. I'll fix this.

Since FastCopy works also for reference types, this can be changed to:
	typea == typeb
or:
	dest_type.IsAssignableFrom (src_type)

> > Third, in the current implementation calling Copy(source, dest, length),
> > the "(source == null || dest == null)" check is done _three_ times
> > when one is enough.
> 
> The two checks in Copy (Array, int, Array, int, int) are a bug, but the
> two checks in Copy (Array, Array, int) are a feature - if this is a
> problem, then we need to provide a null-safe GetLowerBounds ....

Oh, you're right, thanks for correcting me.

lupus

-- 
-----------------------------------------------------------------
lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better