mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
feat: Add a dictionary to cache abs_root_path results
This commit is contained in:
parent
b654a16b48
commit
a864ab9888
1 changed files with 5 additions and 2 deletions
|
@ -71,6 +71,7 @@ class Coder:
|
||||||
test_outcome = None
|
test_outcome = None
|
||||||
multi_response_content = ""
|
multi_response_content = ""
|
||||||
rejected_urls = set()
|
rejected_urls = set()
|
||||||
|
abs_root_path_cache = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(
|
def create(
|
||||||
|
@ -397,8 +398,10 @@ class Coder:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def abs_root_path(self, path):
|
def abs_root_path(self, path):
|
||||||
res = Path(self.root) / path
|
if path not in self.abs_root_path_cache:
|
||||||
return utils.safe_abs_path(res)
|
res = Path(self.root) / path
|
||||||
|
self.abs_root_path_cache[path] = utils.safe_abs_path(res)
|
||||||
|
return self.abs_root_path_cache[path]
|
||||||
|
|
||||||
fences = [
|
fences = [
|
||||||
("``" + "`", "``" + "`"),
|
("``" + "`", "``" + "`"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue