| 246 #ifndef CX_STRSTR_SBO_SIZE |
246 #ifndef CX_STRSTR_SBO_SIZE |
| 247 #define CX_STRSTR_SBO_SIZE 128 |
247 #define CX_STRSTR_SBO_SIZE 128 |
| 248 #endif |
248 #endif |
| 249 const unsigned cx_strstr_sbo_size = CX_STRSTR_SBO_SIZE; |
249 const unsigned cx_strstr_sbo_size = CX_STRSTR_SBO_SIZE; |
| 250 |
250 |
| 251 cxstring cx_strstr( |
251 cxstring cx_strstr_(cxstring haystack, cxstring needle) { |
| 252 cxstring haystack, |
|
| 253 cxstring needle |
|
| 254 ) { |
|
| 255 if (needle.length == 0) { |
252 if (needle.length == 0) { |
| 256 return haystack; |
253 return haystack; |
| 257 } |
254 } |
| 258 |
255 |
| 259 // optimize for single-char needles |
256 // optimize for single-char needles |