Skip to content

filestats() changed to return a smart pointer.

Paal Kvamme requested to merge kvamme62/smart-filestats into master

The return value from filestats() will be cached on first access if the file is opened read only. The function takes O(n) time relative to the file size, but is fast enough that performance will only be noticeable on really huge files, Also, the open itself has a similar scan of all indices. So calling filestats() will always take significantly less time than the open.

If you worry about taking a performance hit the first time the information is actually used then just do a dummy call to filestats() in the same function that opens the file.

Merge request reports