From cdf9c435489fa6ffa85685c8316a5dd6d8c34db0 Mon Sep 17 00:00:00 2001 From: Louis Brandy Date: Wed, 19 Jun 2013 16:39:45 -0700 Subject: [PATCH] rename template parameters in folly::greater_than Summary: This template is only used in folly::Conv (to avoid tautological comparisons) and as best as I can tell, the rhs/lhs names are not correct as it's currently used (and not consistent with `less_than`). Just swap rhs/lhs variable names. Test Plan: Test Results Summary: Passed: 471 100% successful Reviewed By: marcelo.juchem@fb.com FB internal diff: D856785 --- folly/Traits.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/folly/Traits.h b/folly/Traits.h index db8bd33a..f09a9136 100644 --- a/folly/Traits.h +++ b/folly/Traits.h @@ -359,32 +359,32 @@ bool less_than_impl( return false; } -template +template bool greater_than_impl( typename std::enable_if< - (lhs <= std::numeric_limits::max() - && lhs >= std::numeric_limits::min()), - RHS - >::type const rhs + (rhs <= std::numeric_limits::max() + && rhs >= std::numeric_limits::min()), + LHS + >::type const lhs ) { - return lhs < rhs; + return lhs > rhs; } -template +template bool greater_than_impl( typename std::enable_if< - (lhs > std::numeric_limits::max()), - RHS + (rhs > std::numeric_limits::max()), + LHS >::type const ) { return false; } -template +template bool greater_than_impl( typename std::enable_if< - (lhs < std::numeric_limits::min()), - RHS + (rhs < std::numeric_limits::min()), + LHS >::type const ) { return true; @@ -409,11 +409,11 @@ bool less_than(LHS const lhs) { >(lhs); } -template -bool greater_than(RHS const rhs) { +template +bool greater_than(LHS const lhs) { return detail::greater_than_impl< - LHS, lhs, typename std::remove_reference::type - >(rhs); + RHS, rhs, typename std::remove_reference::type + >(lhs); } } // namespace folly -- 2.34.1