mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 03:19:53 +00:00
Fix RUF015 (next() instead of list comprehensions[0])
https://docs.astral.sh/ruff/rules/-iterable-allocation-for-first-element/
This commit is contained in:
@@ -286,7 +286,7 @@ class IfcCsv:
|
||||
reverse = sort_data["order"] == "DESC"
|
||||
self.results = sorted(self.results, key=lambda x: natural_sort(x[i]), reverse=reverse)
|
||||
else:
|
||||
if include_global_id and len(list(self.results)[0]) > 1:
|
||||
if include_global_id and len(next(iter(self.results))) > 1:
|
||||
self.results = sorted(self.results, key=lambda x: x[1])
|
||||
elif not include_global_id:
|
||||
self.results = sorted(self.results, key=lambda x: x[0])
|
||||
|
||||
Reference in New Issue
Block a user