Side navigation
#1318 closed enhancement (fixed)
Opened June 23, 2007 08:05PM UTC
Closed May 16, 2008 02:34AM UTC
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 (4)
Changed May 12, 2008 01:22AM UTC by comment:1
milestone: | 1.1.3 → 1.2.4 |
---|---|
resolution: | → fixed |
status: | new → closed |
Changed May 12, 2008 08:49AM UTC by comment:2
if (!a != !b)
you could save another few bytes with
a != b
ne two negations are not neccesarry..
Changed May 12, 2008 08:49AM UTC by comment:3
resolution: | fixed |
---|---|
status: | closed → reopened |
Changed May 16, 2008 02:34AM UTC by comment:4
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.
Nice one, applied at [5558].