Skip redundant file/dir tests
This commit is contained in:
parent
c3946dd017
commit
d34c22ac22
@ -154,12 +154,13 @@ char *createFilename(char * const buffer, const dir_t &p) {
|
|||||||
// Return 'true' if the item is a folder or G-code file
|
// Return 'true' if the item is a folder or G-code file
|
||||||
//
|
//
|
||||||
bool CardReader::is_dir_or_gcode(const dir_t &p) {
|
bool CardReader::is_dir_or_gcode(const dir_t &p) {
|
||||||
uint8_t pn0 = p.name[0];
|
//uint8_t pn0 = p.name[0];
|
||||||
|
|
||||||
if ( pn0 == DIR_NAME_FREE || pn0 == DIR_NAME_DELETED // Clear or Deleted entry
|
if ( (p.attributes & DIR_ATT_HIDDEN) // Hidden by attribute
|
||||||
|| pn0 == '.' || longFilename[0] == '.' // Hidden file
|
// When readDir() > 0 these must be false:
|
||||||
|| !DIR_IS_FILE_OR_SUBDIR(&p) // Not a File or Directory
|
//|| pn0 == DIR_NAME_FREE || pn0 == DIR_NAME_DELETED // Clear or Deleted entry
|
||||||
|| (p.attributes & DIR_ATT_HIDDEN) // Hidden by attribute
|
//|| pn0 == '.' || longFilename[0] == '.' // Hidden file
|
||||||
|
//|| !DIR_IS_FILE_OR_SUBDIR(&p) // Not a File or Directory
|
||||||
) return false;
|
) return false;
|
||||||
|
|
||||||
flag.filenameIsDir = DIR_IS_SUBDIR(&p); // We know it's a File or Folder
|
flag.filenameIsDir = DIR_IS_SUBDIR(&p); // We know it's a File or Folder
|
||||||
|
Loading…
Reference in New Issue
Block a user