From: Andrew Trick Date: Tue, 10 Apr 2012 03:12:29 +0000 (+0000) Subject: Use std::includes instead of my own implementation. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c72e08b4a95e494d3bfdf1262ea8b28f614ac40e;p=oota-llvm.git Use std::includes instead of my own implementation. Jakob's review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154377 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/CodeGenRegisters.cpp b/utils/TableGen/CodeGenRegisters.cpp index fc5c78019c3..bd1eefe36f4 100644 --- a/utils/TableGen/CodeGenRegisters.cpp +++ b/utils/TableGen/CodeGenRegisters.cpp @@ -1135,15 +1135,8 @@ findRegUnitSet(const std::vector &UniqueSets, // Return true if the RUSubSet is a subset of RUSuperSet. static bool isRegUnitSubSet(const std::vector &RUSubSet, const std::vector &RUSuperSet) { - for (RegUnitSet::iterator SubIdx = RUSubSet.begin(), EndIdx = RUSubSet.end(), - SearchIdx = RUSuperSet.begin(), SearchEnd = RUSuperSet.end(); - SubIdx != EndIdx; ++SubIdx) { - SearchIdx = find(SearchIdx, SearchEnd, *SubIdx); - if (SearchIdx == SearchEnd) - return false; - ++SearchIdx; - } - return true; + return std::includes(RUSuperSet.begin(), RUSuperSet.end(), + RUSubSet.begin(), RUSubSet.end()); } // Iteratively prune unit sets.