Commit cdf9c435 authored by Louis Brandy's avatar Louis Brandy Committed by Jordan DeLong

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
parent 46de7098
...@@ -359,32 +359,32 @@ bool less_than_impl( ...@@ -359,32 +359,32 @@ bool less_than_impl(
return false; return false;
} }
template <typename LHS, LHS lhs, typename RHS> template <typename RHS, RHS rhs, typename LHS>
bool greater_than_impl( bool greater_than_impl(
typename std::enable_if< typename std::enable_if<
(lhs <= std::numeric_limits<RHS>::max() (rhs <= std::numeric_limits<LHS>::max()
&& lhs >= std::numeric_limits<RHS>::min()), && rhs >= std::numeric_limits<LHS>::min()),
RHS LHS
>::type const rhs >::type const lhs
) { ) {
return lhs < rhs; return lhs > rhs;
} }
template <typename LHS, LHS lhs, typename RHS> template <typename RHS, RHS rhs, typename LHS>
bool greater_than_impl( bool greater_than_impl(
typename std::enable_if< typename std::enable_if<
(lhs > std::numeric_limits<RHS>::max()), (rhs > std::numeric_limits<LHS>::max()),
RHS LHS
>::type const >::type const
) { ) {
return false; return false;
} }
template <typename LHS, LHS lhs, typename RHS> template <typename RHS, RHS rhs, typename LHS>
bool greater_than_impl( bool greater_than_impl(
typename std::enable_if< typename std::enable_if<
(lhs < std::numeric_limits<RHS>::min()), (rhs < std::numeric_limits<LHS>::min()),
RHS LHS
>::type const >::type const
) { ) {
return true; return true;
...@@ -409,11 +409,11 @@ bool less_than(LHS const lhs) { ...@@ -409,11 +409,11 @@ bool less_than(LHS const lhs) {
>(lhs); >(lhs);
} }
template <typename LHS, LHS lhs, typename RHS> template <typename RHS, RHS rhs, typename LHS>
bool greater_than(RHS const rhs) { bool greater_than(LHS const lhs) {
return detail::greater_than_impl< return detail::greater_than_impl<
LHS, lhs, typename std::remove_reference<RHS>::type RHS, rhs, typename std::remove_reference<LHS>::type
>(rhs); >(lhs);
} }
} // namespace folly } // namespace folly
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment