Author: davide Date: Thu Jun 8 18:49:56 2017 New Revision: 305035 URL: http://llvm.org/viewvc/llvm-project?rev=305035&view=rev Log: [VMRange] Simplify a couple of member functions. NFCI.
Modified: lldb/trunk/source/Utility/VMRange.cpp Modified: lldb/trunk/source/Utility/VMRange.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/VMRange.cpp?rev=305035&r1=305034&r2=305035&view=diff ============================================================================== --- lldb/trunk/source/Utility/VMRange.cpp (original) +++ lldb/trunk/source/Utility/VMRange.cpp Thu Jun 8 18:49:56 2017 @@ -25,23 +25,15 @@ using namespace lldb_private; bool VMRange::ContainsValue(const VMRange::collection &coll, lldb::addr_t value) { ValueInRangeUnaryPredicate in_range_predicate(value); - VMRange::const_iterator pos; VMRange::const_iterator end = coll.end(); - pos = std::find_if(coll.begin(), end, in_range_predicate); - if (pos != end) - return true; - return false; + return std::find_if(coll.begin(), end, in_range_predicate) != end; } bool VMRange::ContainsRange(const VMRange::collection &coll, const VMRange &range) { RangeInRangeUnaryPredicate in_range_predicate(range); - VMRange::const_iterator pos; VMRange::const_iterator end = coll.end(); - pos = std::find_if(coll.begin(), end, in_range_predicate); - if (pos != end) - return true; - return false; + return std::find_if(coll.begin(), end, in_range_predicate) != end; } size_t VMRange::FindRangeIndexThatContainsValue(const VMRange::collection &coll, _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits