diff options
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__algorithm/sift_down.h')
| -rw-r--r-- | contrib/llvm-project/libcxx/include/__algorithm/sift_down.h | 9 |
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 |
