================
@@ -94,9 +94,9 @@ class Value;
template <typename T> Value toJSON(const std::optional<T> &Opt);
/// An Object is a JSON object, which maps strings to heterogenous JSON values.
-/// It simulates DenseMap<ObjectKey, Value>. ObjectKey is a maybe-owned string.
+/// ObjectKey is a maybe-owned string.
class Object {
- using Storage = DenseMap<ObjectKey, Value, llvm::DenseMapInfo<StringRef>>;
+ using Storage = std::map<ObjectKey, Value>;
----------------
zixu-w wrote:
>From my understanding of the codebase, `ObjectKey` is always a string, but the
>generalization comes from the need to sometimes own the string. Before finding
>the `DenseMap` issue I also tried to optimize `ObjectKey` to make it just a
>`StringRef`, but sometimes the key can contain JSON escape sequence etc. etc.
>when it needs to be able to create a modified string as the key.
https://github.com/llvm/llvm-project/pull/171230
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits