[PATCH] D100656: [Support] Don't include <algorithm> in MathExtras.h
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 16 08:53:56 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6580d8a2b14d: [Support] Don't include <algorithm> in MathExtras.h (authored by thakis).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100656/new/
https://reviews.llvm.org/D100656
Files:
llvm/include/llvm/Support/MathExtras.h
Index: llvm/include/llvm/Support/MathExtras.h
===================================================================
--- llvm/include/llvm/Support/MathExtras.h
+++ llvm/include/llvm/Support/MathExtras.h
@@ -14,7 +14,6 @@
#define LLVM_SUPPORT_MATHEXTRAS_H
#include "llvm/Support/Compiler.h"
-#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
@@ -793,7 +792,7 @@
/// value of the result.
template <typename T>
std::enable_if_t<std::is_unsigned<T>::value, T> AbsoluteDifference(T X, T Y) {
- return std::max(X, Y) - std::min(X, Y);
+ return X > Y ? X - Y : Y - X;
}
/// Add two unsigned integers, X and Y, of type T. Clamp the result to the
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100656.338140.patch
Type: text/x-patch
Size: 678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210416/82e13879/attachment.bin>
More information about the llvm-commits
mailing list