aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorBilly O'Neal (VC LIBS) <bion@microsoft.com>2018-11-15 11:24:24 -0800
committerBilly O'Neal (VC LIBS) <bion@microsoft.com>2018-11-15 11:24:24 -0800
commit02839ae4a83d505bae17d5856ce851af29c89c65 (patch)
tree401e72a83fc30d9e0aaa76a07f0612693dca92fb /toolsrc/include
parentf1eb3aa4b95540a8fb4a8e8d341e4c08136bd756 (diff)
downloadvcpkg-02839ae4a83d505bae17d5856ce851af29c89c65.tar.gz
vcpkg-02839ae4a83d505bae17d5856ce851af29c89c65.zip
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.
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg/base/util.h12
1 files changed, 0 insertions, 12 deletions
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
@@ -72,18 +72,6 @@ namespace vcpkg::Util
}
template<class Container, class Pred>
- void stable_keep_if(Container& cont, Pred pred)
- {
- cont.erase(std::stable_partition(cont.begin(), cont.end(), pred), cont.end());
- }
-
- template<class Container, class Pred>
- void unstable_keep_if(Container& cont, Pred pred)
- {
- cont.erase(std::partition(cont.begin(), cont.end(), pred), cont.end());
- }
-
- template<class Container, class Pred>
void erase_remove_if(Container& cont, Pred pred)
{
cont.erase(std::remove_if(cont.begin(), cont.end(), pred), cont.end());