================
@@ -410,17 +408,13 @@ def filename_from_module(module_name: str, check_name:
str) -> str:
with io.open(module_file, "r") as f:
code = f.read()
full_check_name = module_name + "-" + check_name
- name_pos = code.find('"' + full_check_name + '"')
- if name_pos == -1:
+ if (name_pos := code.find('"' + full_check_name + '"')) == -1:
return ""
- stmt_end_pos = code.find(";", name_pos)
- if stmt_end_pos == -1:
- return ""
- stmt_start_pos = code.rfind(";", 0, name_pos)
- if stmt_start_pos == -1:
- stmt_start_pos = code.rfind("{", 0, name_pos)
- if stmt_start_pos == -1:
+ if (stmt_end_pos := code.find(";", name_pos)) == -1:
return ""
+ if (stmt_start_pos := code.rfind(";", 0, name_pos)) == -1:
+ if (stmt_start_pos := code.rfind("{", 0, name_pos)) == -1:
----------------
EugeneZelenko wrote:
Could be merged with `and`.
https://github.com/llvm/llvm-project/pull/176927
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits