Skip to content

Commit a9a6f17

Browse files
committed
Cleanup map lookup checks a bit
1 parent 5c95cad commit a9a6f17

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

genbindings.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,11 @@ def map_fn(line, re_match, ret_arr_len, c_call_string, doc_comment):
440440
write_c(out_c_delta)
441441

442442
out_java_struct = None
443-
if ("LDK" + struct_meth in opaque_structs or "LDK" + struct_meth in trait_structs
444-
or "LDK" + struct_meth in complex_enums or "LDKC" + struct_meth in complex_enums
445-
or "LDKC" + struct_meth in result_types) and not is_free:
443+
expected_struct = "LDK" + struct_meth
444+
expected_cstruct = "LDKC" + struct_meth
445+
if (expected_struct in opaque_structs or expected_struct in trait_structs
446+
or expected_struct in complex_enums or expected_cstruct in complex_enums
447+
or expected_cstruct in result_types) and not is_free:
446448
out_java_struct = open(f"{sys.argv[3]}/structs/{struct_meth}{consts.file_ext}", "a")
447449
elif method_name.startswith("C2Tuple_") and method_name.endswith("_read"):
448450
struct_meth = method_name.rsplit("_", 1)[0]

0 commit comments

Comments
 (0)