From: Michael Lee Date: Sat, 25 Feb 2017 02:08:13 +0000 (-0800) Subject: Fix -Wshadow warning in sorted_vector_types X-Git-Tag: v2017.03.06.00~21 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=29deb3cf1ad48e5e3169bf67f9fa9b42cfed93d7;p=folly.git Fix -Wshadow warning in sorted_vector_types Summary: `last` was already passed in as a variable, so switch this so there isn't a local variable at all. Reviewed By: mlogan, yfeldblum Differential Revision: D4615206 fbshipit-source-id: dd8e3157e54dc2abe3dfd97837ce327371f4f7b2 --- diff --git a/folly/sorted_vector_types.h b/folly/sorted_vector_types.h index f70f7979..fe586a86 100644 --- a/folly/sorted_vector_types.h +++ b/folly/sorted_vector_types.h @@ -171,14 +171,15 @@ namespace detail { } if (middle != cont.begin() && cmp(*middle, *(middle - 1))) { std::inplace_merge(cont.begin(), middle, cont.end(), cmp); - auto last = std::unique( - cont.begin(), - cont.end(), - [&](typename OurContainer::value_type const& a, - typename OurContainer::value_type const& b) { - return !cmp(a, b) && !cmp(b, a); - }); - cont.erase(last, cont.end()); + cont.erase( + std::unique( + cont.begin(), + cont.end(), + [&](typename OurContainer::value_type const& a, + typename OurContainer::value_type const& b) { + return !cmp(a, b) && !cmp(b, a); + }), + cont.end()); } } }