Skip to content

Remove Guardrails from NumberedObjectCollection #895

@MicahGale

Description

@MicahGale

Originally NumberedObjectCollection was very wary of self.__num_cache because it was using "mutable data" as the keys. With #867 now though there should in theory be no case in which the cache is not up to date. Right now whenever this is a cache miss it is assumed it is a true miss, and not that the object is missing, so an $O(N)$ search is completed before a KeyError is raised. This is expensive, especially for renumbering tasks.

I believe now that this guardrail of search before a KeyError is no longer necessary. See this guardrail that is no longer covered because of this.

Metadata

Metadata

Assignees

Labels

code improvementA feature request that will improve the software and its maintainability, but be invisible to users.performance 🐌Issues related to speed and memory

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions