mirror of git://gcc.gnu.org/git/gcc.git
Avoid redundant calls to filesystem::status_known
* include/bits/fs_ops.h (exists(const path&, error_code&))): Only check status_known once. * include/experimental/bits/fs_ops.h: Likewise. From-SVN: r256243
This commit is contained in:
parent
c54af0682c
commit
f7373fce65
|
|
@ -1,5 +1,9 @@
|
||||||
2018-01-04 Jonathan Wakely <jwakely@redhat.com>
|
2018-01-04 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
* include/bits/fs_ops.h (exists(const path&, error_code&))): Only
|
||||||
|
check status_known once.
|
||||||
|
* include/experimental/bits/fs_ops.h: Likewise.
|
||||||
|
|
||||||
PR libstdc++/83607
|
PR libstdc++/83607
|
||||||
* include/std/functional (__is_byte_like): New trait.
|
* include/std/functional (__is_byte_like): New trait.
|
||||||
(__is_std_equal_to): Remove.
|
(__is_std_equal_to): Remove.
|
||||||
|
|
|
||||||
|
|
@ -125,8 +125,11 @@ namespace filesystem
|
||||||
{
|
{
|
||||||
auto __s = status(__p, __ec);
|
auto __s = status(__p, __ec);
|
||||||
if (status_known(__s))
|
if (status_known(__s))
|
||||||
__ec.clear();
|
{
|
||||||
return exists(__s);
|
__ec.clear();
|
||||||
|
return __s.type() != file_type::not_found;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uintmax_t file_size(const path& __p);
|
uintmax_t file_size(const path& __p);
|
||||||
|
|
|
||||||
|
|
@ -131,8 +131,11 @@ inline namespace v1
|
||||||
{
|
{
|
||||||
auto __s = status(__p, __ec);
|
auto __s = status(__p, __ec);
|
||||||
if (status_known(__s))
|
if (status_known(__s))
|
||||||
__ec.clear();
|
{
|
||||||
return exists(__s);
|
__ec.clear();
|
||||||
|
return __s.type() != file_type::not_found;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uintmax_t file_size(const path& __p);
|
uintmax_t file_size(const path& __p);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue