From efdff71b05828054040b7de51c90454b7615134c Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 4 Jan 2017 20:10:43 +0000 Subject: YAML: Remove Input::MapHNode::isValidKey(), use llvm::is_contained() instead. NFC. llvm-svn: 290999 --- llvm/lib/Support/YAMLTraits.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'llvm/lib/Support/YAMLTraits.cpp') diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp index 51c016b1d55..9849b3aa1ce 100644 --- a/llvm/lib/Support/YAMLTraits.cpp +++ b/llvm/lib/Support/YAMLTraits.cpp @@ -175,7 +175,7 @@ void Input::endMapping() { if (!MN) return; for (const auto &NN : MN->Mapping) { - if (!MN->isValidKey(NN.first())) { + if (!is_contained(MN->ValidKeys, NN.first())) { setError(NN.second.get(), Twine("unknown key '") + NN.first() + "'"); break; } @@ -385,14 +385,6 @@ std::unique_ptr Input::createHNodes(Node *N) { } } -bool Input::MapHNode::isValidKey(StringRef Key) { - for (std::string &K : ValidKeys) { - if (Key == K) - return true; - } - return false; -} - void Input::setError(const Twine &Message) { this->setError(CurrentNode, Message); } -- cgit v1.2.3