scripts: gen_dts_cmake: a small optimization
Using edt.chosen_nodes looks like a simple attribute lookup, but it's actually calling a property that will create a new list of chosen nodes every time. Apply a small optimization by only creating the list once. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
54b6d26242
commit
b65b49bef6
1 changed files with 3 additions and 2 deletions
|
@ -83,8 +83,9 @@ def main():
|
||||||
# macros.bnf for C macros.
|
# macros.bnf for C macros.
|
||||||
|
|
||||||
cmake_props = []
|
cmake_props = []
|
||||||
for node in edt.chosen_nodes:
|
chosen_nodes = edt.chosen_nodes
|
||||||
path = edt.chosen_nodes[node].path
|
for node in chosen_nodes:
|
||||||
|
path = chosen_nodes[node].path
|
||||||
cmake_props.append(f'"DT_CHOSEN|{node}" "{path}"')
|
cmake_props.append(f'"DT_CHOSEN|{node}" "{path}"')
|
||||||
|
|
||||||
for node in edt.nodes:
|
for node in edt.nodes:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue