mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
fix recursion depth: some algorithms
This commit is contained in:
parent
bb59363682
commit
e2b207d3be
34 changed files with 796 additions and 87 deletions
|
@ -14,7 +14,7 @@ namespace sprout {
|
|||
return mid == last ? mid
|
||||
: pred(*mid) ? sprout::detail::partition_point_impl(
|
||||
sprout::next(mid), last, pred,
|
||||
sprout::next(mid, 1 + sprout::distance(sprout::next(mid), last) / 2)
|
||||
sprout::next(mid, 1 + (sprout::distance(mid, last) - 1) / 2)
|
||||
)
|
||||
: sprout::detail::partition_point_impl(
|
||||
first, mid, pred,
|
||||
|
@ -27,8 +27,7 @@ namespace sprout {
|
|||
// 25.3.13 Partitions
|
||||
//
|
||||
// recursion depth:
|
||||
// [first, last) is RandomAccessIterator -> O(log N)
|
||||
// otherwise -> O(N)
|
||||
// O(log N)
|
||||
//
|
||||
template<typename ForwardIterator, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR ForwardIterator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue