Chromium Code Reviews| Index: src/utils.h |
| diff --git a/src/utils.h b/src/utils.h |
| index 93cded18bcd2f9c07dc9c29ec567bbc565bb3520..b16730b8c46d750c1e264ad07713868c2b32d804 100644 |
| --- a/src/utils.h |
| +++ b/src/utils.h |
| @@ -232,6 +232,13 @@ T Min(T a, T b) { |
| } |
| +// Returns the negative absolute value of its argument. |
| +template <typename T> |
| +T NegAbs(T a) { |
| + return a < 0 ? a : -a; |
| +} |
| + |
| + |
| inline int StrLength(const char* string) { |
| size_t length = strlen(string); |
| ASSERT(length == static_cast<size_t>(static_cast<int>(length))); |