Re: [PATCH] libbb/last_char_is: rewrite for smaller and faster code

2020-07-02 Thread Jody Bruchon
On July 2, 2020 3:26:29 PM EDT, Tito wrote: >hi, >just for fun I add my version: > >char* FAST_FUNC last_char_is(const char *s, int c) { > while (s && *s && *(s + 1)) s++; > return (c == *s) ? (char *)s : NULL; >} That's pretty small, but it performs three comparisons for each

Re: [PATCH] libbb/last_char_is: rewrite for smaller and faster code

2020-07-02 Thread Tito
On 7/2/20 12:02 AM, Jody Bruchon wrote: > From 10389ff81b4ee5a7db293cf5d6205d8944e51901 Mon Sep 17 00:00:00 2001 > From: Jody Bruchon > Date: Wed, 1 Jul 2020 17:55:04 -0400 > Subject: [PATCH] libbb/last_char_is: rewrite for smaller and faster code > > Signed-off-by: Jody Bruchon > --- >  

Re: [PATCH] libbb/last_char_is: rewrite for smaller and faster code

2020-07-02 Thread Kang-Che Sung
On Friday, July 3, 2020, Jody Bruchon wrote: > > > On July 2, 2020 11:29:06 AM EDT, Kang-Che Sung wrote: >>On Thursday, July 2, 2020, Jody Bruchon wrote: >>> /* Find out if the last character of a string matches the one given >>*/ >>> -char* FAST_FUNC last_char_is(const char *s, int c) >>>

Re: [PATCH] libbb/last_char_is: rewrite for smaller and faster code

2020-07-02 Thread Kang-Che Sung
On Thursday, July 2, 2020, Jody Bruchon wrote: > /* Find out if the last character of a string matches the one given */ > -char* FAST_FUNC last_char_is(const char *s, int c) > +char* FAST_FUNC last_char_is(char *s, char c) Why are you removing the const qualifier, and how would that reduce the

Re: [PATCH 2/2] udhcpc: fixed a TODO in fill_envp using option scanner

2020-07-02 Thread Martin Lewis
Thank you for applying the commits! I started implementing support for RFC 3396, hopefully it will be ready soon. Martin On Mon, 29 Jun 2020 at 08:40, Denys Vlasenko wrote: > Applied, thanks > > On Tue, Jun 23, 2020 at 3:41 PM Martin Lewis > wrote: > > > > fill_envp now iterates over the