[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH v2] readlink: slight size optimization
From:       Eric Blake <eblake () redhat ! com>
Date:       2023-04-18 12:14:33
Message-ID: 3jk5gybi7l7eiahutg72olee5lfj5hk7obklaf7cc24oc3ijvg () wikf2sxuxyid
[Download RAW message or body]

On Mon, Apr 17, 2023 at 10:43:36PM +0100, Harald van Dijk wrote:
> 
> I am assuming it was intended to be
> 
>   printf("%s%s", buf, &"\n"[opt & 1]);

Bah, yes, the missing & is the culprit.  I don't want to dereference
the pointer, I want the adjusted pointer.  It might look better as
"\n" + (opt & 1), although that's a matter of opinion.

> 
> > I did not test if this reduces size.

With the typo fixed (I must have tested one version, then posted a
different one), tests pass, and bloatcheck now shows with either
corrected spelling:

function                                             old     new   delta
readlink_main                                        121     117      -4

Will post corrected v3.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic