I've said it before: there should only be one str* function in the standard lib: `strnlen`, and it should only be used to implement safer \
@stephentyrone And don't forget strstr which has no easy substitute, although of course strnstr would be preferable.
-
-
@RichFelker `strstr` is horrific. If strings are short, you're better off using stupid algorithm. If long, you want the length anyway. -
@RichFelker So you really want to know the string lengths to choose code path; given that you'll almost certainly perform some other string -
@RichFelker operation, the cost of computing the length can be effectively amortized. -
@RichFelker Can one construct microbenchmark of small unrelated strstrs? Of course. Who cares?
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.