From 2c79b381fc93503fe4d88ddcd91884e3cb4e168a Mon Sep 17 00:00:00 2001 From: HitBlast Date: Sat, 10 Feb 2024 21:52:26 +0600 Subject: [PATCH] reduced code overhead on `bijoy` boolean flag --- avro/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/avro/main.py b/avro/main.py index 96f7c9f..06651b7 100755 --- a/avro/main.py +++ b/avro/main.py @@ -105,13 +105,12 @@ def output_generator() -> Generator[str, None, None]: if bijoy: # Converts output to Bijoy format if applied. def convert_to_bijoy(text: str) -> str: - text = re.sub('ো', 'ো', text) - text = re.sub('ৌ', 'ৌ', text) + text = re.sub('ৌ', 'ৌ', re.sub('ো', 'ো', text)) for unic in config.AVRO_TO_BIJ: - text = re.sub(unic, config.AVRO_TO_BIJ[unic], text).strip() + text = re.sub(unic, config.AVRO_TO_BIJ[unic], text) - return text + return text.strip() output = _concurrency_helper(convert_to_bijoy, output)