diff options
author | iseg <iseg@yandex-team.ru> | 2022-02-10 16:49:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:39 +0300 |
commit | f828a15ab90e9ca8e848f83caf95c95f06be46e7 (patch) | |
tree | de25241f7ec727b05ff1e5b9e1336f567f788a44 /library/cpp/charset/codepage.cpp | |
parent | 8124e2bb214b063687e0d77c900150c727e16782 (diff) | |
download | ydb-f828a15ab90e9ca8e848f83caf95c95f06be46e7.tar.gz |
Restoring authorship annotation for <iseg@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/charset/codepage.cpp')
-rw-r--r-- | library/cpp/charset/codepage.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/charset/codepage.cpp b/library/cpp/charset/codepage.cpp index 0431bef31b..8e2df10531 100644 --- a/library/cpp/charset/codepage.cpp +++ b/library/cpp/charset/codepage.cpp @@ -64,26 +64,26 @@ char* CodePage::ToUpper(const char* b, char* to) const { } int CodePage::stricmp(const char* dst, const char* src) const { - unsigned char f, l; - do { + unsigned char f, l; + do { f = ToLower(*dst++); l = ToLower(*src++); - } while (f && (f == l)); - return f - l; -} - + } while (f && (f == l)); + return f - l; +} + int CodePage::strnicmp(const char* dst, const char* src, size_t len) const { - unsigned char f, l; - if (len) { - do { + unsigned char f, l; + if (len) { + do { f = ToLower(*dst++); l = ToLower(*src++); - } while (--len && f && (f == l)); - return f - l; - } - return 0; -} - + } while (--len && f && (f == l)); + return f - l; + } + return 0; +} + static const CodePage UNSUPPORTED_CODEPAGE = { CODES_UNSUPPORTED, { @@ -179,7 +179,7 @@ public: } } } - + inline ECharset CharsetByName(TStringBuf name) { if (!name) return CODES_UNKNOWN; @@ -187,15 +187,15 @@ public: TData::const_iterator it = Data.find(name); if (it == Data.end()) return CODES_UNKNOWN; - + return it->second; } }; ECharset CharsetByName(TStringBuf name) { return Singleton<TCodePageHash>()->CharsetByName(name); -} - +} + ECharset CharsetByNameOrDie(TStringBuf name) { ECharset result = CharsetByName(name); if (result == CODES_UNKNOWN) |