aboutsummaryrefslogtreecommitdiffstats
path: root/tools/snippets_translate/handlers.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-10-02 14:38:06 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-10-02 16:13:01 +0200
commit37fa79a4ef18fdd59addb0daed2ce2eff6e5e2a5 (patch)
tree2cdbb3e300bfa5a3d70f281c57b55ec64d7c9100 /tools/snippets_translate/handlers.py
parent604591ee13e39c4d9953fb56322ca85bdaf01e74 (diff)
snippets_translate: Replace C++ ++/-- operators by +=/-=
Generate "var += 1" instead of "var = var + 1". Change-Id: Ia9b3b3e4135156ebac8b7d5b1f47c735e2be1458 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'tools/snippets_translate/handlers.py')
-rw-r--r--tools/snippets_translate/handlers.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/snippets_translate/handlers.py b/tools/snippets_translate/handlers.py
index 7941dc9ed..10bc9d00e 100644
--- a/tools/snippets_translate/handlers.py
+++ b/tools/snippets_translate/handlers.py
@@ -87,7 +87,7 @@ def handle_inc_dec(x, operator):
clean_x = x.strip()
if clean_x.startswith(operator) or clean_x.endswith(operator):
x = x.replace(operator, "")
- x = f"{x} = {clean_x.replace(operator, '')} {operator[0]} 1"
+ x = f"{x} {operator[0]}= 1"
return x