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?

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to