This patch introduces new SearchDirIdx type to the internal HeaderSearch code that tracks search path usage. The type replaces the current uses of unsigned to identify DirectoryLookup objects.
In a follow-up patch (D116750), this type will become resilient against insertions "into the middle" of SearchDirs as done by HeaderSearch::AddSearchPath().
I would have expected these to be methods on HeaderSearch. Is there a particular reason why these are methods on SearchDirIdx?