From c165aaed2fefccaeacc5441ca83463b0ddfb50a5 Mon Sep 17 00:00:00 2001 From: Kirill Belousov Date: Sat, 16 Sep 2023 23:11:09 +0300 Subject: [PATCH] Added replacement caching which may improve speed in some cases --- addon/globalPlugins/textnormalizer/textnormalizer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addon/globalPlugins/textnormalizer/textnormalizer.py b/addon/globalPlugins/textnormalizer/textnormalizer.py index 40089ef..5c5d71d 100644 --- a/addon/globalPlugins/textnormalizer/textnormalizer.py +++ b/addon/globalPlugins/textnormalizer/textnormalizer.py @@ -12,6 +12,7 @@ except ImportError: import logging as log +@lru_cache(16384) def normalizer_replace_text(old, new, string, case_insensitive = False): if case_insensitive: return string.replace(old, new)