From: Matt Corallo Date: Tue, 30 Mar 2021 20:01:13 +0000 (-0400) Subject: Cleanup map lookup checks a bit X-Git-Tag: v0.0.98~5^2~2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=a9a6f1747f8466e99abd5972bf675d310f6d7222;p=ldk-java Cleanup map lookup checks a bit --- diff --git a/genbindings.py b/genbindings.py index 1a0f7dd1..12649658 100755 --- a/genbindings.py +++ b/genbindings.py @@ -440,9 +440,11 @@ with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java: write_c(out_c_delta) out_java_struct = None - if ("LDK" + struct_meth in opaque_structs or "LDK" + struct_meth in trait_structs - or "LDK" + struct_meth in complex_enums or "LDKC" + struct_meth in complex_enums - or "LDKC" + struct_meth in result_types) and not is_free: + expected_struct = "LDK" + struct_meth + expected_cstruct = "LDKC" + struct_meth + if (expected_struct in opaque_structs or expected_struct in trait_structs + or expected_struct in complex_enums or expected_cstruct in complex_enums + or expected_cstruct in result_types) and not is_free: out_java_struct = open(f"{sys.argv[3]}/structs/{struct_meth}{consts.file_ext}", "a") elif method_name.startswith("C2Tuple_") and method_name.endswith("_read"): struct_meth = method_name.rsplit("_", 1)[0]