aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/__algorithm/sift_down.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-03-20 11:40:34 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-06-04 11:58:51 +0000
commit4b6eb0e63c698094db5506763df44cc83c19f643 (patch)
treef1d30b8c10bc6db323b91538745ae8ab8b593910 /contrib/llvm-project/libcxx/include/__algorithm/sift_down.h
parent76886853f03395abb680824bcc74e98f83bd477a (diff)
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__algorithm/sift_down.h')
-rw-r--r--contrib/llvm-project/libcxx/include/__algorithm/sift_down.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/contrib/llvm-project/libcxx/include/__algorithm/sift_down.h b/contrib/llvm-project/libcxx/include/__algorithm/sift_down.h
index dd4b54ed8e5f..4d99ff237c96 100644
--- a/contrib/llvm-project/libcxx/include/__algorithm/sift_down.h
+++ b/contrib/llvm-project/libcxx/include/__algorithm/sift_down.h
@@ -17,9 +17,6 @@
#pragma GCC system_header
#endif
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Compare, class _RandomAccessIterator>
@@ -41,7 +38,7 @@ __sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/,
__child = 2 * __child + 1;
_RandomAccessIterator __child_i = __first + __child;
- if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + 1))) {
+ if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + difference_type(1)))) {
// right-child exists and is greater than left-child
++__child_i;
++__child;
@@ -66,7 +63,7 @@ __sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/,
__child = 2 * __child + 1;
__child_i = __first + __child;
- if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + 1))) {
+ if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + difference_type(1)))) {
// right-child exists and is greater than left-child
++__child_i;
++__child;
@@ -79,6 +76,4 @@ __sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/,
_LIBCPP_END_NAMESPACE_STD
-_LIBCPP_POP_MACROS
-
#endif // _LIBCPP___ALGORITHM_SIFT_DOWN_H