[Lldb-commits] [lldb] r305035 - [VMRange] Simplify a couple of member functions. NFCI.
Zachary Turner via lldb-commits
lldb-commits at lists.llvm.org
Thu Jun 8 16:55:18 PDT 2017
Note that even simpler would be
```
return llvm::find_if(col, in_range_predicate) != col.end();
```
On Thu, Jun 8, 2017 at 4:50 PM Davide Italiano via lldb-commits <
lldb-commits at lists.llvm.org> wrote:
> 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 at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170608/34f24e65/attachment.html>
More information about the lldb-commits
mailing list