libstdc++: Avoid including <algorithm> in <filesystem> [PR92546]
This only affects Windows, but reduces the preprocessed size of <filesystem> significantly. libstdc++-v3/ChangeLog: PR libstdc++/92546 * include/bits/fs_path.h (path::make_preferred): Use handwritten loop instead of std::replace.
This commit is contained in:
parent
38ce448963
commit
00df7ee447
@ -52,7 +52,6 @@
|
||||
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
# define _GLIBCXX_FILESYSTEM_IS_WINDOWS 1
|
||||
# include <algorithm>
|
||||
#endif
|
||||
|
||||
namespace std _GLIBCXX_VISIBILITY(default)
|
||||
@ -1060,8 +1059,12 @@ namespace __detail
|
||||
path::make_preferred()
|
||||
{
|
||||
#ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
|
||||
std::replace(_M_pathname.begin(), _M_pathname.end(), L'/',
|
||||
preferred_separator);
|
||||
auto __pos = _M_pathname.find(L'/');
|
||||
while (__pos != _M_pathname.npos)
|
||||
{
|
||||
_M_pathname[__pos] = preferred_separator;
|
||||
__pos = _M_pathname.find(L'/', __pos);
|
||||
}
|
||||
#endif
|
||||
return *this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user