From 29deb3cf1ad48e5e3169bf67f9fa9b42cfed93d7 Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Fri, 24 Feb 2017 18:08:13 -0800 Subject: [PATCH] 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 --- folly/sorted_vector_types.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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()); } } } -- 2.34.1