From 79d38b5d6820c3bdf43f4460ff5d8d1ef4e72cb9 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 10 May 2023 18:21:41 -0700 Subject: [PATCH] handle the simple replace case quickly --- aider/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aider/utils.py b/aider/utils.py index 7f895c13b..4dd575d47 100644 --- a/aider/utils.py +++ b/aider/utils.py @@ -7,6 +7,9 @@ from pathlib import Path def replace_most_similar_chunk(whole, part, replace): + if part in whole: + return whole.replace(part, replace) + similarity_thresh = 0.8 max_similarity = 0