Skip to contentSkip to conversation

vmstate-static-checker:remove this redundant return

PATCH Applied dinglimin 3 participants 3 messages Sep 28, 2022 – Oct 22, 2022

lore
Share & tools
lore

dinglimin

author
#0 lore raw

PATCH 1/1 vmstate-static-checker:remove this redundant return

Jump statements, such as return and continue let you change the default flow of program execution, but jump statements that direct the control flow to the original direction are just a waste of keystrokes.

---
 scripts/vmstate-static-checker.py | 1 -
 1 file changed, 1 deletion(-)
scripts/vmstate-static-checker.py +0 -1
index b369388360..dfeee8231a 100755
@@ -367,7 +367,6 @@ def check_machine_type(s, d):
     if s["Name"] != d["Name"]:
         print("Warning: checking incompatible machine types:", end=' ')
         print("\"" + s["Name"] + "\", \"" + d["Name"] + "\"")
-    return
 
 
 def main():
Signature · 1 line
2.30.0.windows.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · dinglimin

Jump statements, such as return and continue let you change the default flow of program execution, but jump statements that direct the control flow to the original direction are just a waste of keystrokes.

---
 scripts/vmstate-static-checker.py | 1 -
 1 file changed, 1 deletion(-)
scripts/vmstate-static-checker.py +0 -2
index b369388360..dfeee8231a 100755
@@ -367,7 +367,6 @@ def check_machine_type(s, d):
     if s["Name"] != d["Name"]:
         print("Warning: checking incompatible machine types:", end=' ')
         print("\"" + s["Name"] + "\", \"" + d["Name"] + "\"")
-    return
 
 
 def main():
--
Quoted 2 lines

2.30.0.windows.2

This can go through the trivial branch.

#2 lore raw
In reply to dinglimin

Le 28/09/2022 à 11:03, dinglimin a écrit :

Quoted 15 lines

Jump statements, such as return and continue let you change the default flow of program execution, but jump statements that direct the control flow to the original direction are just a waste of keystrokes.

---
  scripts/vmstate-static-checker.py | 1 -
  1 file changed, 1 deletion(-)
scripts/vmstate-static-checker.py +0 -0
index b369388360..dfeee8231a 100755

scripts/vmstate-static-checker.py def check_machine_type(s, d): · line 372

Quoted 7 lines
scripts/vmstate-static-checker.py +0 -1
@@ -367,7 +367,6 @@ def check_machine_type(s, d):
      if s["Name"] != d["Name"]:
          print("Warning: checking incompatible machine types:", end=' ')
          print("\"" + s["Name"] + "\", \"" + d["Name"] + "\"")
-    return
 
 
  def main():

Applied to my trivial-patches branch.

Thanks,
Laurent