From 42531260b3e0cc6256bd64911fc3db7aea59a68e Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Fri, 12 Aug 2016 03:55:06 +0000 Subject: Use the range variant of find/find_if instead of unpacking begin/end If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278469 --- llvm/utils/TableGen/FixedLenDecoderEmitter.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'llvm/utils/TableGen/FixedLenDecoderEmitter.cpp') diff --git a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp index 1200324d6b0..733c7549b2c 100644 --- a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp +++ b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp @@ -1108,9 +1108,7 @@ unsigned FilterChooser::getDecoderIndex(DecoderSet &Decoders, // Make sure the predicate is in the table. Decoders.insert(StringRef(Decoder)); // Now figure out the index for when we write out the table. - DecoderSet::const_iterator P = std::find(Decoders.begin(), - Decoders.end(), - Decoder.str()); + DecoderSet::const_iterator P = find(Decoders, Decoder.str()); return (unsigned)(P - Decoders.begin()); } @@ -1183,9 +1181,7 @@ unsigned FilterChooser::getPredicateIndex(DecoderTableInfo &TableInfo, // Make sure the predicate is in the table. TableInfo.Predicates.insert(Predicate.str()); // Now figure out the index for when we write out the table. - PredicateSet::const_iterator P = std::find(TableInfo.Predicates.begin(), - TableInfo.Predicates.end(), - Predicate.str()); + PredicateSet::const_iterator P = find(TableInfo.Predicates, Predicate.str()); return (unsigned)(P - TableInfo.Predicates.begin()); } -- cgit v1.2.3