Tracker: Check FSGetTrashDir() status, GetNextRef() is faster
Change-Id: I4f700a9170bc86aea73e4f9959ef05d1a4ddd6da Reviewed-on: https://review.haiku-os.org/c/haiku/+/10635 Tested-by: Commit checker robot <[email protected]> Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
b283cb27dc
commit
0f098ae692
@@ -213,11 +213,13 @@ BTrashWatcher::CheckTrashDirs()
|
||||
continue;
|
||||
|
||||
BDirectory trashDir;
|
||||
FSGetTrashDir(&trashDir, volume.Device());
|
||||
trashDir.Rewind();
|
||||
BEntry entry;
|
||||
if (trashDir.GetNextEntry(&entry) == B_OK)
|
||||
return true;
|
||||
if (FSGetTrashDir(&trashDir, volume.Device()) == B_OK) {
|
||||
trashDir.Rewind();
|
||||
// GetNextRef() is a bit faster than GetNextEntry()
|
||||
entry_ref ref;
|
||||
if (trashDir.GetNextRef(&ref) == B_OK)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user