basarat/typescript-collections

LinkedList remove all matching compare function

Closed this issue · 1 comments

Hi,

It would be nice to include method in LinkedList removing all elements matching compare function.

Something like:

export interface IMatchFunction<T> {
	(a: T): boolean
}

removeAll(removeMatch: IMatchFunction<T>): number {

	//Remove all elements for which removeMatch returned true
	
	//Returns number of removed elements
	
}

This would allow removing elements without having full object handles.

Closing this because of old age. If the issue persists, please let me know.

Please open a PR with this feature.