Replace AString with std::string.
This commit is contained in:
+1
-1
Submodule public/amtl updated: 5376e7763f...98cbbdd11a
@@ -74,7 +74,7 @@ class NameHashSet : public ke::SystemAllocatorPolicy
|
||||
|
||||
static bool matches(const CharsAndLength &key, const KeyType &value)
|
||||
{
|
||||
return KeyPolicyType::matches(key.chars(), value);
|
||||
return KeyPolicyType::matches(key.c_str(), value);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -92,7 +92,7 @@ class NameHashSet : public ke::SystemAllocatorPolicy
|
||||
|
||||
static bool matches(const CharsAndLength &key, const KeyType *value)
|
||||
{
|
||||
return KeyType::matches(key.chars(), value);
|
||||
return KeyType::matches(key.c_str(), value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace detail
|
||||
uint32_t hash() const {
|
||||
return hash_;
|
||||
}
|
||||
const char *chars() const {
|
||||
const char *c_str() const {
|
||||
return str_;
|
||||
}
|
||||
size_t length() const {
|
||||
@@ -90,9 +90,9 @@ namespace detail
|
||||
|
||||
struct StringHashMapPolicy
|
||||
{
|
||||
static inline bool matches(const CharsAndLength &lookup, const ke::AString &key) {
|
||||
static inline bool matches(const CharsAndLength &lookup, const std::string &key) {
|
||||
return lookup.length() == key.length() &&
|
||||
memcmp(lookup.chars(), key.chars(), key.length()) == 0;
|
||||
memcmp(lookup.c_str(), key.c_str(), key.length()) == 0;
|
||||
}
|
||||
static inline uint32_t hash(const CharsAndLength &key) {
|
||||
return key.hash();
|
||||
@@ -104,7 +104,7 @@ template <typename T>
|
||||
class StringHashMap
|
||||
{
|
||||
typedef detail::CharsAndLength CharsAndLength;
|
||||
typedef ke::HashMap<ke::AString, T, detail::StringHashMapPolicy> Internal;
|
||||
typedef ke::HashMap<std::string, T, detail::StringHashMapPolicy> Internal;
|
||||
|
||||
public:
|
||||
StringHashMap()
|
||||
|
||||
Reference in New Issue
Block a user