From 02839ae4a83d505bae17d5856ce851af29c89c65 Mon Sep 17 00:00:00 2001 From: "Billy O'Neal (VC LIBS)" Date: Thu, 15 Nov 2018 11:24:24 -0800 Subject: vcpkg was going out of its way to use partition before calling the container erase function which is slower than just using remove_if. remove_if is already stable, so separate stable and unstable versions are unnecessary. https://iterator.wordpress.com/2016/01/31/algorithms_0/ Unstable remove_if algorithms are possible that might win, as indicated in that article; but plain remove_if provides the most consistent behavior. --- toolsrc/include/vcpkg/base/util.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index 7266fbbc6..65ce02b99 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -71,18 +71,6 @@ namespace vcpkg::Util return ret; } - template - void stable_keep_if(Container& cont, Pred pred) - { - cont.erase(std::stable_partition(cont.begin(), cont.end(), pred), cont.end()); - } - - template - void unstable_keep_if(Container& cont, Pred pred) - { - cont.erase(std::partition(cont.begin(), cont.end(), pred), cont.end()); - } - template void erase_remove_if(Container& cont, Pred pred) { -- cgit v1.2.3