[m-dev.] diff: simplifying int or float comparisons

Zoltan Somogyi zs at cs.mu.oz.au
Tue Mar 25 11:37:46 AEDT 1997


>  		(
> +						% e==e => true
>  			Vn1 = Vn2
>  		->
>  			Vnrval = vn_const(true),
>  			VnTables = VnTables0
>  		;
> +						% otherwise, c1==c2 => false
> +						% (true case handled above)
> +			Vnrval1 = vn_const(_C1),
> +			Vnrval2 = vn_const(_C2)
> +		->
> +			Vnrval = vn_const(false),
> +			VnTables = VnTables0
> +		;

To me it would seem more robust to put in the test C1 \= C2. It would cost
very little in performance, since comparing two consts is VERY rare.

> +						% otherwise, c1!=c2 => true
> +						% (false case handled above)
> +			Vnrval1 = vn_const(_C1),
> +			Vnrval2 = vn_const(_C2)
> +		->

The converse here; the rest is fine.

Do you have code that benefits from these changes?

Zoltan.



More information about the developers mailing list