| 28 | } |
| 29 | |
| 30 | const char * |
| 31 | FindStringSuffix(const char *p, const char *suffix) noexcept |
| 32 | { |
| 33 | const size_t p_length = StringLength(p); |
| 34 | const size_t suffix_length = StringLength(suffix); |
| 35 | |
| 36 | if (p_length < suffix_length) |
| 37 | return nullptr; |
| 38 | |
| 39 | const char *q = p + p_length - suffix_length; |
| 40 | return std::memcmp(q, suffix, suffix_length) == 0 |
| 41 | ? q |
| 42 | : nullptr; |
| 43 | } |
no outgoing calls
no test coverage detected