mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Add StringRef hasher, comparator.
This commit is contained in:
parent
670a292416
commit
fa2559b3f0
@ -44,6 +44,22 @@ struct StringRef
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct StringRefHasher
|
||||||
|
{
|
||||||
|
size_t operator()( const StringRef& key ) const
|
||||||
|
{
|
||||||
|
return charutil::hash( (const char*)&key, sizeof( StringRef ) );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct StringRefComparator
|
||||||
|
{
|
||||||
|
bool operator()( const StringRef& lhs, const StringRef& rhs ) const
|
||||||
|
{
|
||||||
|
return memcmp( &lhs, &rhs, sizeof( StringRef ) ) == 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class StringIdx
|
class StringIdx
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user