ash: [REDIR] Move null redirect checks into caller
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 25 Oct 2016 19:46:03 +0000 (21:46 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 25 Oct 2016 19:46:03 +0000 (21:46 +0200)
commiteaf9436b08f68be8b96730307fe1da1faf374ee0
tree88f6a907a913ef8a72a47c0b1ea0725fa8c3ea93
parent2a6d29ad5ce652c03ed8324a0d14f62594f2dd84
ash: [REDIR] Move null redirect checks into caller

Upstream commit:

    Date: Thu, 27 May 2010 14:21:17 +0800
    [REDIR] Move null redirect checks into caller

    The null redirect checks were added as an optimisation to avoid
    unnecessary memory allocations.  However, we could avoid this
    completely by simply making the caller avoid making a redirection
    unless it is not null.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
function                                             old     new   delta
evaltree                                             784     809     +25
evalcommand                                         1251    1261     +10
hashvar                                               59      62      +3
dotcmd                                               321     319      -2
clearredir                                            37      30      -7
popredir                                             183     162     -21
redirect                                            1264    1233     -31
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/4 up/down: 63/-61)            Total: -23 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c