(no title)
zrm | 2 months ago
But then you're accessing four elements of a string that could have a strlen of less than 3. If the strlen is 1 then the short circuit case saves you because s[1] will be '\0' instead of 'e' and then you don't access elements past the end of the string. The "optimized" version is UB for short strings.
Denvercoder9|2 months ago
immibis|2 months ago
zrm|2 months ago