File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,13 @@ class String {
181
181
return *this ;
182
182
}
183
183
184
+ u32 hash () const
185
+ {
186
+ if (!m_impl)
187
+ return 0 ;
188
+ return m_impl->hash ();
189
+ }
190
+
184
191
ByteBuffer to_byte_buffer () const ;
185
192
186
193
template <typename BufferType>
@@ -205,7 +212,10 @@ class String {
205
212
}
206
213
#endif
207
214
208
- StringView view () const { return { characters (), length () }; }
215
+ StringView view () const
216
+ {
217
+ return { characters (), length () };
218
+ }
209
219
210
220
private:
211
221
bool match_helper (const StringView& mask) const ;
@@ -234,7 +244,6 @@ struct Traits<String> : public GenericTraits<String> {
234
244
struct CaseInsensitiveStringTraits : public AK ::Traits<String> {
235
245
static unsigned hash (const String& s) { return s.impl () ? s.to_lowercase ().impl ()->hash () : 0 ; }
236
246
static bool equals (const String& a, const String& b) { return a.to_lowercase () == b.to_lowercase (); }
237
-
238
247
};
239
248
240
249
inline bool operator <(const char * characters, const String& string)
@@ -271,5 +280,5 @@ inline bool operator<=(const char* characters, const String& string)
271
280
272
281
}
273
282
274
- using AK::String;
275
283
using AK::CaseInsensitiveStringTraits;
284
+ using AK::String;
You can’t perform that action at this time.
0 commit comments