From 77346daaa54e81233dcf8ff7158a5cde4b2c35ee Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 14 May 2020 20:56:49 +0200 Subject: [PATCH] [StringSet] Simplify code a bit. NFC. --- llvm/include/llvm/ADT/StringSet.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/ADT/StringSet.h b/llvm/include/llvm/ADT/StringSet.h index 2a17db0..63d9293 100644 --- a/llvm/include/llvm/ADT/StringSet.h +++ b/llvm/include/llvm/ADT/StringSet.h @@ -31,13 +31,13 @@ public: explicit StringSet(AllocatorTy a) : Base(a) {} std::pair insert(StringRef key) { - return Base::insert(std::make_pair(key, None)); + return Base::try_emplace(key); } template void insert(const InputIt &begin, const InputIt &end) { for (auto it = begin; it != end; ++it) - Base::insert(std::make_pair(*it, None)); + insert(*it); } template -- 2.7.4