dired-hacks icon indicating copy to clipboard operation
dired-hacks copied to clipboard

refactor(dired-collapse): avoid using function 'length' on lists

Open Boruch-Baum opened this issue 4 months ago • 3 comments

This PR will improve efficiency on directories with many files, in two locations, from O(n) to O(1). This is because Lisp needs to traverse "true" lists in order to determine their lengths. emacs-lisp "cheats" in that many of its data structures are really vectors/arrays instead of "true" lisp lists, but not in the cases subject to this PR, IIUC.

Boruch-Baum avatar Mar 11 '24 15:03 Boruch-Baum