From 959c6bb44f5ca06bdad78929a6188ea0dcd09f1f Mon Sep 17 00:00:00 2001 From: HitBlast Date: Mon, 1 Jan 2024 23:36:55 +0600 Subject: [PATCH] Refactor reverse_with_rules function to handle additional cases --- avro/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/avro/main.py b/avro/main.py index 08d4621..e5b63ed 100755 --- a/avro/main.py +++ b/avro/main.py @@ -235,9 +235,9 @@ def reverse_with_rules(cursor: int, fixed_text: str, text_reversed: str) -> str: added_suffix = 'o' try: - if fixed_text[cursor + 1] in config.AVRO_KAR: - added_suffix = '' - if fixed_text[cursor + 2] in config.AVRO_KAR and not cursor == 0: + if (fixed_text[cursor + 1] in config.AVRO_KAR) or ( + fixed_text[cursor + 2] in config.AVRO_KAR and not cursor == 0 + ): added_suffix = '' except IndexError: