Cache the results of is_exe_in_path.

Review Request #11823 — Created Sept. 27, 2021 and submitted — Latest diff uploaded

Information

RBTools
master

Reviewers

is_exe_in_path() may be called multiple times with the same executable
name, particularly when running from unit tests. Since an executable is
unlikely to appear or disappear within the lifetime of a process run in
a way that impacts RBTools, it's not worth re-scanning the whole path
every time we need to know if an executable is available.

This change adds caching behavior to is_exe_in_path(). Now, a repeated
call with the same executable name (with or without a .exe file
extension) will return the prior cached result.

All unit tests pass.

Commits

Files