mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 13:37:48 +00:00
ls: add a comment
This commit is contained in:
parent
6b1f51385f
commit
28d684b5ac
1 changed files with 2 additions and 0 deletions
|
@ -1812,6 +1812,7 @@ struct PathData {
|
||||||
// Result<MetaData> got from symlink_metadata() or metadata() based on config
|
// Result<MetaData> got from symlink_metadata() or metadata() based on config
|
||||||
md: OnceCell<Option<Metadata>>,
|
md: OnceCell<Option<Metadata>>,
|
||||||
ft: OnceCell<Option<FileType>>,
|
ft: OnceCell<Option<FileType>>,
|
||||||
|
// can be used to avoid reading the metadata. Can be also called d_type
|
||||||
de: Option<DirEntry>,
|
de: Option<DirEntry>,
|
||||||
// Name of the file - will be empty for . or ..
|
// Name of the file - will be empty for . or ..
|
||||||
display_name: OsString,
|
display_name: OsString,
|
||||||
|
@ -1911,6 +1912,7 @@ impl PathData {
|
||||||
self.md
|
self.md
|
||||||
.get_or_init(|| {
|
.get_or_init(|| {
|
||||||
// check if we can use DirEntry metadata
|
// check if we can use DirEntry metadata
|
||||||
|
// it will avoid a call to stat()
|
||||||
if !self.must_dereference {
|
if !self.must_dereference {
|
||||||
if let Some(dir_entry) = &self.de {
|
if let Some(dir_entry) = &self.de {
|
||||||
return dir_entry.metadata().ok();
|
return dir_entry.metadata().ok();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue