diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2019-05-28 20:39:48 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-05-28 20:39:48 +0100 |
commit | 441ed45ca2abe83f78be48e6ca816e9ec6e27222 (patch) | |
tree | c1876a43ff7fce4b9302209be2ba1be30429da12 /gcc | |
parent | d9b401df8f3eda8bcb647cae0c07c9bd19bff00b (diff) | |
download | gcc-441ed45ca2abe83f78be48e6ca816e9ec6e27222.zip gcc-441ed45ca2abe83f78be48e6ca816e9ec6e27222.tar.gz gcc-441ed45ca2abe83f78be48e6ca816e9ec6e27222.tar.bz2 |
PR libstdc++/90634 reduce allocations in filesystem::path construction
PR libstdc++/90634
* include/experimental/bits/fs_path.h (path::path(path&&)): Only call
_M_split_cmpts() for a path with multiple components.
(path::_S_is_dir_sep()): Add missing 'static' keyword to function.
* src/filesystem/path.cc (path::_M_split_cmpts()): Count number of
components and reserve space in vector. Return early when there is
only one component.
* testsuite/27_io/filesystem/path/construct/90634.cc: New test.
* testsuite/experimental/filesystem/path/construct/90634.cc: New test.
From-SVN: r271717
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions