[libcxx-commits] [libcxx] 928852f - [libc++] [NFC] Remove an unused parameter from `__sift_down`.

Arthur O'Dwyer via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 29 13:26:03 PST 2021


Author: Arthur O'Dwyer
Date: 2021-12-29T16:25:33-05:00
New Revision: 928852f1560ae8708d5c48e2e33911ef05457d58

URL: https://github.com/llvm/llvm-project/commit/928852f1560ae8708d5c48e2e33911ef05457d58
DIFF: https://github.com/llvm/llvm-project/commit/928852f1560ae8708d5c48e2e33911ef05457d58.diff

LOG: [libc++] [NFC] Remove an unused parameter from `__sift_down`.

Differential Revision: https://reviews.llvm.org/D116382

Added: 
    

Modified: 
    libcxx/include/__algorithm/make_heap.h
    libcxx/include/__algorithm/partial_sort.h
    libcxx/include/__algorithm/partial_sort_copy.h
    libcxx/include/__algorithm/pop_heap.h
    libcxx/include/__algorithm/sift_down.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__algorithm/make_heap.h b/libcxx/include/__algorithm/make_heap.h
index b3defd4de072c..a67c798ee7dd2 100644
--- a/libcxx/include/__algorithm/make_heap.h
+++ b/libcxx/include/__algorithm/make_heap.h
@@ -32,7 +32,7 @@ __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compar
         // start from the first parent, there is no need to consider children
         for (
diff erence_type __start = (__n - 2) / 2; __start >= 0; --__start)
         {
-            _VSTD::__sift_down<_Compare>(__first, __last, __comp, __n, __first + __start);
+            _VSTD::__sift_down<_Compare>(__first, __comp, __n, __first + __start);
         }
     }
 }

diff  --git a/libcxx/include/__algorithm/partial_sort.h b/libcxx/include/__algorithm/partial_sort.h
index 622624ec4f422..017ac90b67142 100644
--- a/libcxx/include/__algorithm/partial_sort.h
+++ b/libcxx/include/__algorithm/partial_sort.h
@@ -40,7 +40,7 @@ __partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _R
         if (__comp(*__i, *__first))
         {
             swap(*__i, *__first);
-            _VSTD::__sift_down<_Compare>(__first, __middle, __comp, __len, __first);
+            _VSTD::__sift_down<_Compare>(__first, __comp, __len, __first);
         }
     }
     _VSTD::__sort_heap<_Compare>(__first, __middle, __comp);

diff  --git a/libcxx/include/__algorithm/partial_sort_copy.h b/libcxx/include/__algorithm/partial_sort_copy.h
index 4c0c9f5ad04a5..a81c621c75c6b 100644
--- a/libcxx/include/__algorithm/partial_sort_copy.h
+++ b/libcxx/include/__algorithm/partial_sort_copy.h
@@ -40,7 +40,7 @@ __partial_sort_copy(_InputIterator __first, _InputIterator __last,
             if (__comp(*__first, *__result_first))
             {
                 *__result_first = *__first;
-                _VSTD::__sift_down<_Compare>(__result_first, __r, __comp, __len, __result_first);
+                _VSTD::__sift_down<_Compare>(__result_first, __comp, __len, __result_first);
             }
         _VSTD::__sort_heap<_Compare>(__result_first, __r, __comp);
     }

diff  --git a/libcxx/include/__algorithm/pop_heap.h b/libcxx/include/__algorithm/pop_heap.h
index e8c801a5c81f8..1d57de24ff044 100644
--- a/libcxx/include/__algorithm/pop_heap.h
+++ b/libcxx/include/__algorithm/pop_heap.h
@@ -31,7 +31,7 @@ __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare
     if (__len > 1)
     {
         swap(*__first, *--__last);
-        _VSTD::__sift_down<_Compare>(__first, __last, __comp, __len - 1, __first);
+        _VSTD::__sift_down<_Compare>(__first, __comp, __len - 1, __first);
     }
 }
 

diff  --git a/libcxx/include/__algorithm/sift_down.h b/libcxx/include/__algorithm/sift_down.h
index 4d99ff237c966..bf5447698cd65 100644
--- a/libcxx/include/__algorithm/sift_down.h
+++ b/libcxx/include/__algorithm/sift_down.h
@@ -21,8 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Compare, class _RandomAccessIterator>
 _LIBCPP_CONSTEXPR_AFTER_CXX11 void
-__sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/,
-            _Compare __comp,
+__sift_down(_RandomAccessIterator __first, _Compare __comp,
             typename iterator_traits<_RandomAccessIterator>::
diff erence_type __len,
             _RandomAccessIterator __start)
 {
@@ -46,7 +45,7 @@ __sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/,
 
     // check if we are in heap-order
     if (__comp(*__child_i, *__start))
-        // we are, __start is larger than it's largest child
+        // we are, __start is larger than its largest child
         return;
 
     value_type __top(_VSTD::move(*__start));


        


More information about the libcxx-commits mailing list