[PATCH] shrink last_char_is function even more

Michael Conrad mconrad at intellitree.com
Sun Jul 19 22:56:41 UTC 2020


On 7/19/2020 2:48 PM, Denys Vlasenko wrote:
> strrchr(s,c) will first find the end of s, then go backwards looking for c.
> The second part is wasted work, we only need to check the*last*  char == c.

Maybe a naive implementation, but why wouldn't they just record the last 
occurrence on a forward scan?



More information about the busybox mailing list