Skip to content

Commit 80c6da3

Browse files
authored
eds: Fix typo in manufacturer_idices → manufacturer_indices (#642)
Also use comparison instead of range() for a minor performance improvement.
1 parent 2be54f3 commit 80c6da3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • canopen/objectdictionary

canopen/objectdictionary/eds.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,19 +496,19 @@ def export_record(var, eds):
496496
def mandatory_indices(x):
497497
return x in {0x1000, 0x1001, 0x1018}
498498

499-
def manufacturer_idices(x):
500-
return x in range(0x2000, 0x6000)
499+
def manufacturer_indices(x):
500+
return 0x2000 <= x < 0x6000
501501

502502
def optional_indices(x):
503503
return all((
504504
x > 0x1001,
505505
not mandatory_indices(x),
506-
not manufacturer_idices(x),
506+
not manufacturer_indices(x),
507507
))
508508

509509
supported_mantatory_indices = list(filter(mandatory_indices, od))
510510
supported_optional_indices = list(filter(optional_indices, od))
511-
supported_manufacturer_indices = list(filter(manufacturer_idices, od))
511+
supported_manufacturer_indices = list(filter(manufacturer_indices, od))
512512

513513
def add_list(section, list):
514514
eds.add_section(section)

0 commit comments

Comments
 (0)