File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ MimeTypes TMimeTypes::MimeByStr(const char* str) const {
158158}
159159
160160MimeTypes TMimeTypes::MimeByStr (const TStringBuf& str) const {
161- TRecordHash::const_iterator it = ContentTypes.find (str);
161+ TRecordHash::const_iterator it = ContentTypes.find (str. data () );
162162 if (it == ContentTypes.end ())
163163 return MIME_UNKNOWN;
164164 return Records[it->second ].Mime ;
Original file line number Diff line number Diff line change @@ -387,11 +387,11 @@ _ydb_sdk_add_library(yutil)
387387
388388target_compile_options (yutil PUBLIC
389389 -DTSTRING_IS_STD_STRING
390+ -DNO_CUSTOM_CHAR_PTR_STD_COMPARATOR
390391)
391392
392393target_compile_options (yutil PRIVATE
393394 -Wnarrowing
394- -DNO_CUSTOM_CHAR_PTR_STD_COMPARATOR
395395)
396396
397397target_link_libraries (yutil PUBLIC
Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ _ydb_sdk_add_library(util-charset)
66
77target_compile_options (util-charset PUBLIC
88 -DTSTRING_IS_STD_STRING
9+ -DNO_CUSTOM_CHAR_PTR_STD_COMPARATOR
910)
1011
1112target_compile_options (util-charset PRIVATE
1213 -Wnarrowing
13- -DNO_CUSTOM_CHAR_PTR_STD_COMPARATOR
1414)
1515
1616target_joined_source(util-charset
Original file line number Diff line number Diff line change @@ -211,6 +211,13 @@ struct TEqualTo<TUtf32String>: public TEqualTo<TUtf32StringBuf> {
211211 using is_transparent = void ;
212212};
213213
214+ template <>
215+ struct TEqualTo <const char *> {
216+ inline bool operator ()(const char * a, const char * b) const {
217+ return strcmp (a, b) == 0 ;
218+ }
219+ };
220+
214221template <class TFirst , class TSecond >
215222struct TEqualTo <std::pair<TFirst, TSecond>> {
216223 template <class TOther >
@@ -264,6 +271,13 @@ struct TLess<TUtf32String>: public TLess<TUtf32StringBuf> {
264271 using is_transparent = void ;
265272};
266273
274+ template <>
275+ struct TLess <const char *> {
276+ inline bool operator ()(const char * a, const char * b) const {
277+ return strcmp (a, b) < 0 ;
278+ }
279+ };
280+
267281template <class T >
268282struct TGreater : public std ::greater<T> {
269283};
You can’t perform that action at this time.
0 commit comments