Inefficient Disk Detection #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
_get_all_disks() calls glob.glob() multiple times and uses sets inefficiently:
Current approach scans filesystem multiple times
for pattern in ['/dev/sd[a-z]', '/dev/nvme[0-9]n[0-9]']:
matches = glob.glob(pattern)
Optimize:
def _get_all_disks(self) -> List[str]:
"""Get all physical disks efficiently."""
disks = set()