@@ -140,10 +140,8 @@ extern bool InjectAndEncodeCustomType(Item *item, const TypeContext &tc);
140140// Template version that works with both Item and Field types
141141// Both Item and Field have has_type_context() and get_type_context() methods
142142// Overload for TypeContext with binary data
143- inline std::optional<int > TryCompareCustomType (const TypeContext &tc,
144- const uchar *data1, size_t len1,
145- const uchar *data2,
146- size_t len2) {
143+ inline int CompareCustomType (const TypeContext &tc, const uchar *data1,
144+ size_t len1, const uchar *data2, size_t len2) {
147145 assert (tc.descriptor ());
148146 return tc.descriptor ()->compare_op ().invoke (data1, len1, data2, len2);
149147}
@@ -156,8 +154,7 @@ std::optional<int> TryCompareCustomType(const T *obj, const uchar *data1,
156154 return std::nullopt ;
157155 }
158156
159- return TryCompareCustomType (*obj->get_type_context (), data1, len1, data2,
160- len2);
157+ return CompareCustomType (*obj->get_type_context (), data1, len1, data2, len2);
161158}
162159
163160// Template overload for comparing two String objects with custom type context
@@ -168,7 +165,7 @@ std::optional<int> TryCompareCustomType(const T *obj, const String &str1,
168165 return std::nullopt ;
169166 }
170167
171- return TryCompareCustomType (
168+ return CompareCustomType (
172169 *obj->get_type_context (), pointer_cast<const uchar *>(str1.ptr ()),
173170 str1.length (), pointer_cast<const uchar *>(str2.ptr ()), str2.length ());
174171}
@@ -181,7 +178,7 @@ inline std::optional<int> TryCompareCustomType(const TypeContext *tc,
181178 return std::nullopt ;
182179 }
183180
184- return TryCompareCustomType (
181+ return CompareCustomType (
185182 *tc, pointer_cast<const uchar *>(str1.ptr ()), str1.length (),
186183 pointer_cast<const uchar *>(str2.ptr ()), str2.length ());
187184}
0 commit comments