refactor: tr_quickfindFirstK --> std::partial_sort (#1794)

* refactor: tr_quickfindFirstK --> std::partial_sort

Remove `tr_quickfindFirstK()` and use `std::partial_sort()` instead.

Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
This commit is contained in:
Charles Kerr
2021-09-15 09:32:07 -05:00
committed by GitHub
parent 32fab5a67b
commit fc0ba38bc9
7 changed files with 70 additions and 279 deletions

View File

@@ -218,9 +218,6 @@ int tr_lowerBound(
tr_voidptr_compare_func compar,
bool* exact_match) TR_GNUC_HOT TR_GNUC_NONNULL(1, 5, 6);
/** @brief moves the best k items to the first slots in the array. O(n) */
void tr_quickfindFirstK(void* base, size_t nmemb, size_t size, tr_voidptr_compare_func compar, size_t k);
/**
* @brief sprintf() a string into a newly-allocated buffer large enough to hold it
* @return a newly-allocated string that can be freed with tr_free()