develooper Front page | perl.perl5.porters | Postings from December 2000

SvFAKE (was Re: pp_add -> pp_i_add efficiency hack?)

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
December 12, 2000 07:07
Subject:
SvFAKE (was Re: pp_add -> pp_i_add efficiency hack?)
Message ID:
200012121506.PAA12289@mikado.tiuk.ti.com
Nicholas Clark <nick@ccl4.org> writes:
>How come sv_2iv has
>	if (SvREADONLY(sv) && SvFAKE(sv)) {
>	    sv_force_normal(sv);
>	}
>
>but sv_2uv and sv_2nv don't have the same code in the similar position?

They don't _need_ it because they both do sv_upgrade() to NV if they
get a POK only SV. sv_upgrade() now does the de-FAKEing.

>
>Should such code to force_normal be in sv_2nv and sv_2uv?

Yes.

And I am reminded that 

    else if (SvPOKp(sv) && SvLEN(sv)) {
	I32 numtype = looks_like_number(sv);

why SvLEN() and not SvCUR there ????


>
>Nicholas Clark
-- 
Nick Ing-Simmons <nik@tiuk.ti.com>
Via, but not speaking for: Texas Instruments Ltd.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About