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: |
Description
Hi,
we can save save bytes in grep replacing the line
if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
with
if ( !inv != !fn(elems[i],i) )
Attachments (1)
Change History (5)
Changed 16 years ago by
Attachment: | grep.patch added |
---|
comment:1 Changed 15 years ago by
Milestone: | 1.1.3 → 1.2.4 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Nice one, applied at [5558].
comment:2 Changed 15 years ago by
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
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:4 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
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.
Patch