PriorityCache.whenNewAndLeastPriority

Called by attemptCreateNode() when the cache is full and the new item to be added has a lower priority than the already existing lowest priority item. The method decides which of the two items should be stored.

This implementation favors the new element over the existing element. The user can override this method to implement a different behavior.

class PriorityCache(T)
protected
bool
whenNewAndLeastPriority

Parameters

new_item_lowest_priority ulong

the priority of new item to be added

current_lowest_priority ulong

the priority of the lowest existing item

Return Value

Type: bool

true if the new item with lower priority should replace the current existing lowest priority item, false otherwise.

Meta