mirror of
https://github.com/rui314/mold.git
synced 2024-11-14 16:31:42 +03:00
temporary
This commit is contained in:
parent
5a892728d2
commit
709d511a3d
11
mold.h
11
mold.h
@ -135,17 +135,10 @@ class ConcurrentMap {
|
|||||||
public:
|
public:
|
||||||
typedef tbb::concurrent_hash_map<StringRef, ValueT> MapT;
|
typedef tbb::concurrent_hash_map<StringRef, ValueT> MapT;
|
||||||
|
|
||||||
ValueT *lookup(StringRef key) {
|
|
||||||
typename MapT::accessor acc;
|
|
||||||
if (map.find(acc, key))
|
|
||||||
return &acc->second;
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
ValueT *insert(StringRef key, const ValueT &val) {
|
ValueT *insert(StringRef key, const ValueT &val) {
|
||||||
typename MapT::accessor acc;
|
typename MapT::const_accessor acc;
|
||||||
map.insert(acc, std::make_pair(key, val));
|
map.insert(acc, std::make_pair(key, val));
|
||||||
return &acc->second;
|
return const_cast<ValueT *>(&acc->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user