src: Remove strcompare

This commit is contained in:
Tatsuhiro Tsujikawa 2016-03-25 00:16:25 +09:00
parent 2d2d6c3cc0
commit 1699aef609
2 changed files with 0 additions and 21 deletions

View File

@ -348,25 +348,6 @@ time_t parse_http_date(const StringRef &s) {
return nghttp2_timegm_without_yday(&tm);
}
int strcompare(const char *a, const uint8_t *b, size_t bn) {
assert(a && b);
const uint8_t *blast = b + bn;
for (; *a && b != blast; ++a, ++b) {
if (*a < *b) {
return -1;
} else if (*a > *b) {
return 1;
}
}
if (!*a && b == blast) {
return 0;
} else if (b == blast) {
return 1;
} else {
return -1;
}
}
bool strifind(const char *a, const char *b) {
if (!a || !b) {
return false;

View File

@ -275,8 +275,6 @@ bool iends_with_l(const StringRef &a, const CharT(&b)[N]) {
return iends_with(std::begin(a), std::end(a), b, b + N - 1);
}
int strcompare(const char *a, const uint8_t *b, size_t n);
template <typename InputIt1, typename InputIt2>
bool strieq(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2) {
if (std::distance(first1, last1) != std::distance(first2, last2)) {