VecFilterMapT Method

Creates a new vector by filtering and mapping at the same time.

Definition

Namespace: Austra.Library.Helpers
Assembly: Austra.Library (in Austra.Library.dll) Version: 2.5.0+d1268756e036101f601080f153b3997e72fc912d
C#
public static T[] FilterMap<T>(
	this T[] values,
	Func<T, bool> predicate,
	Func<T, T> mapper
)
where T : struct, new()

Parameters

values  T
The array to transform.
predicate  FuncT, Boolean
The predicate to evaluate.
mapper  FuncT, T
The mapping function.

Type Parameters

T
The type of the array.

Return Value

T
A new array with the filtered items.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type T. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

This method can save an intermediate buffer and one iteration.

See Also