mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 20:47:46 +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
|
||||
md: OnceCell<Option<Metadata>>,
|
||||
ft: OnceCell<Option<FileType>>,
|
||||
// can be used to avoid reading the metadata. Can be also called d_type
|
||||
de: Option<DirEntry>,
|
||||
// Name of the file - will be empty for . or ..
|
||||
display_name: OsString,
|
||||
|
@ -1911,6 +1912,7 @@ impl PathData {
|
|||
self.md
|
||||
.get_or_init(|| {
|
||||
// check if we can use DirEntry metadata
|
||||
// it will avoid a call to stat()
|
||||
if !self.must_dereference {
|
||||
if let Some(dir_entry) = &self.de {
|
||||
return dir_entry.metadata().ok();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue