Bug Tracker

Opened 16 years ago

Closed 15 years ago

#1318 closed enhancement (fixed)

save some bytes in grep

Reported by: rformato Owned by:
Priority: minor Milestone: 1.2.4
Component: core Version: 1.1.2
Keywords: Cc:
Blocked by: Blocking:



we can save save bytes in grep replacing the line if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )


if ( !inv != !fn(elems[i],i) )

Attachments (1)

grep.patch (459 bytes) - added by rformato 16 years ago.

Download all attachments as: .zip

Change History (5)

Changed 16 years ago by rformato

Attachment: grep.patch added


comment:1 Changed 15 years ago by flesler

Resolution: fixed
Status: newclosed

Nice one, applied at [5558].

comment:2 Changed 15 years ago by Markus.Staab

if (!a != !b)

you could save another few bytes with

a != b

ne two negations are not neccesarry..

comment:3 Changed 15 years ago by Markus.Staab

Resolution: fixed
Status: closedreopened

comment:4 Changed 15 years ago by flesler

Resolution: fixed
Status: reopenedclosed

Wrong, a could be null, and b, false.. or a similar case. Casting both to bolean ensures equality.

Please reopen if you disagree.

Note: See TracTickets for help on using tickets.