aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/python-internal.h')
-rw-r--r--gdb/python/python-internal.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 722edbd1a1c..8925714f3c1 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -1209,13 +1209,7 @@ private:
template<typename O>
Storage *get_storage (O *owner, const StorageKey<O> &key) const
{
- Storage *r = key.get (owner);
- if (r == nullptr)
- {
- r = new Storage();
- key.set (owner, r);
- }
- return r;
+ return &key.try_emplace (owner);
}
Storage *get_storage (struct objfile* objf) const