-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Change: patch[Issue / PR] describes a small non-breaking change, such as bugfix or an optimization[Issue / PR] describes a small non-breaking change, such as bugfix or an optimizationDomain: main[Issue / PR] describes change in the functionality, its optimization[Issue / PR] describes change in the functionality, its optimizationPending: unclear[Issue] not yet fully defined[Issue] not yet fully definedPriority: high[Issue / PR] must be addressed as soon as possible[Issue / PR] must be addressed as soon as possibleType: improvement[Issue / PR] addresses lack of a functionality or an open possibility of enhancement[Issue / PR] addresses lack of a functionality or an open possibility of enhancementgood first issue[Issue] can be addressed by a first-time contributor[Issue] can be addressed by a first-time contributor
Description
memo is implemented as a simple JavaScript array (a stack). When being limited, it should have elements removed from its head, and this operation is O(n) in stacks, which is a pain in the arse. Would memo be implemented as a queue, this operation would be O(1), but the API might be changed in a way that's not intuitive for JavaScript developers.
Make sure that:
memois a queue (in bothPredicateandNextFactory);- all elements of
memoare properly index-accessible, similar to arrays (Proxy?); .unshift()is an alias for.enqueue();.pop()is an alias for.dequeue();
It is worth noting for anybody who is reading this, that mutating memo is undefined behavior, and could lead to nasty hard-to-trace bugs.
Metadata
Metadata
Assignees
Labels
Change: patch[Issue / PR] describes a small non-breaking change, such as bugfix or an optimization[Issue / PR] describes a small non-breaking change, such as bugfix or an optimizationDomain: main[Issue / PR] describes change in the functionality, its optimization[Issue / PR] describes change in the functionality, its optimizationPending: unclear[Issue] not yet fully defined[Issue] not yet fully definedPriority: high[Issue / PR] must be addressed as soon as possible[Issue / PR] must be addressed as soon as possibleType: improvement[Issue / PR] addresses lack of a functionality or an open possibility of enhancement[Issue / PR] addresses lack of a functionality or an open possibility of enhancementgood first issue[Issue] can be addressed by a first-time contributor[Issue] can be addressed by a first-time contributor