Skip to content

Commit

Permalink
Avoid reordering lists with use flags
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Jan 8, 2025
1 parent e933998 commit d3aa791
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions fusesoc/capi2/coredata.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,18 @@ def _expand_use(self, data, flags):

if type(data) == list:
remove = []
append = []
for i in data:
for idx, i in enumerate(data):
if type(i) == str and len(i) > 0 and "?" in i:
expanded = Exprs(i).expand(flags)
if i != expanded:
remove.append(i)
if len(expanded) > 0:
append.append(expanded)
data[idx] = expanded
else:
remove.append(idx)
elif type(i) == dict or type(i) == list:
self._expand_use(i, flags)

for i in remove:
data.remove(i)

for i in append:
data.append(i)
for i in reversed(remove):
data.pop(i)

def _append_lists(self, data):
if type(data) == list:
Expand Down

0 comments on commit d3aa791

Please sign in to comment.