mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
Cache glob resolutions in import graph (#13413)
## Summary These are often repeated; caching the resolutions can have a huge impact.
This commit is contained in:
parent
4e935f7d7d
commit
770b276c21
4 changed files with 88 additions and 37 deletions
|
@ -26,6 +26,11 @@ impl ModuleImports {
|
|||
self.0.insert(path);
|
||||
}
|
||||
|
||||
/// Extend the module imports with additional file paths.
|
||||
pub fn extend(&mut self, paths: impl IntoIterator<Item = SystemPathBuf>) {
|
||||
self.0.extend(paths);
|
||||
}
|
||||
|
||||
/// Returns `true` if the module imports are empty.
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.0.is_empty()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue