1
Fork 0
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:
Sylvestre Ledru 2023-12-16 17:19:06 +01:00
parent 6b1f51385f
commit 28d684b5ac

View file

@ -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();