Rename "clip" to "clamp"

This commit is contained in:
Ben Merritt 2019-08-01 22:23:04 -07:00
parent a4da0deccd
commit 364c834aea
No known key found for this signature in database
GPG Key ID: F8AD20ED4E6239B7
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ static const PhoneNumberUtil* const phoneUtil = PhoneNumberUtil::GetInstance();
* Clips a value to the given (inclusive) range * Clips a value to the given (inclusive) range
*/ */
template <typename T> template <typename T>
T clip(const T& n, const T& lower, const T& upper) { T clamp(const T& n, const T& lower, const T& upper) {
return std::max(lower, std::min(n, upper)); return std::max(lower, std::min(n, upper));
} }
@ -274,7 +274,7 @@ extern "C" {
int64_t compared = number1->compare_fast(*number2); int64_t compared = number1->compare_fast(*number2);
PG_RETURN_INT32(clip<int64_t>(compared, -1, 1)); PG_RETURN_INT32(clamp<int64_t>(compared, -1, 1));
} catch(std::exception& e) { } catch(std::exception& e) {
reportException(e); reportException(e);
} }