My version:
Your version:LISTOP (0x4b240) leave [1] OP (0x4b270) enter COP (0x4b200) nextstate UNOP (0x4b1e0) null LOGOP (0x4b1b0) or UNOP (0x53d20) postinc [2] BINOP (0x53cf0) helem UNOP (0x4d8b0) rv2hv SVOP (0x4d8f0) gv GV (0x511cc) *s UNOP (0x53cd0) lc [1] UNOP (0x53cb0) null [15] SVOP (0xaec40) gvsv GV (0x4753c) *_ LISTOP (0x4d910) print OP (0x4dea0) pushmark UNOP (0x4b190) null [15] SVOP (0x4d940) gvsv GV (0x4753c) *_
LISTOP (0x4b260) leave [1] OP (0x4b290) enter COP (0x4b220) nextstate UNOP (0x4b200) null LOGOP (0x4d940) and BINOP (0x4d910) eq SVOP (0xaec40) const IV (0x47650) 1 UNOP (0x4dea0) preinc BINOP (0x4b1d0) helem UNOP (0x53d10) rv2hv SVOP (0x546b0) gv GV (0x51148) *s UNOP (0x4b1b0) lc [1] UNOP (0x4b190) null [15] SVOP (0x53d30) gvsv GV (0x4753c) *_ LISTOP (0x58490) print OP (0x584c0) pushmark UNOP (0x4d8b0) null [15] SVOP (0x4d8f0) gvsv GV (0x4753c) *_
While your version does save copying the old integer value to a temporary (you realize the temporary sv is allocated at compile-time, right?), it takes two extra ops, which I'm pretty sure costs more cpu time.
And in any case the difference is too minimal (especially compared to lowercasing the string and doing a hash lookup) to justify adding to the code complexity
In reply to Re: Re: Re: state preserving uniq
by xmath
in thread state preserving uniq
by Chady
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |