Skip to content

reporting duplicate list names #146

Description

@yakra

# report any duplicate list names as errors
iflen(duplicate_list_names) >0:
print("Found "+str(len(duplicate_list_names)) +" DUPLICATE_LIST_NAME cases.")
num_found=0
forhinhighway_systems:
forrinh.route_list:
ifr.region+' '+r.list_entry_name() induplicate_list_names:
el.add_error("Duplicate list name: "+r.region+' '+r.list_entry_name())
num_found+=1
print("Added "+str(num_found) +" DUPLICATE_LIST_NAME error entries.")
else:
print("No duplicate list names found.")

->

# report any duplicate list names as errorsiflen(duplicate_list_names) >0:
fordinduplicate_list_names:
el.add_error("Duplicate list name: "+d)
print("Added "+str(len(duplicate_list_names)) +" DUPLICATE_LIST_NAME error entries.")
else:
print("No duplicate list names found.")

...would just add the duplicate list names straight to the ErrorList, without having to iterate thru highway_systems & their route_lists, or duplicate_list_names.
Rather than report duplicate .list names for every Route containing them, they're just reported once each.

Any reason not to do this?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions