AdapterHelper.FindByName Method

Namespace
Kampute.DocToolkit.Metadata.Adapters
Assembly
  • Kampute.DocToolkit.dll

Definition

Finds a member by name using binary search.
public static T FindByName<T>(this IReadOnlyList<T> members, string name)
	where T : IMember

Type Parameters

T
The type of members in the list.

Parameters

members IReadOnlyList<T>
The list of members, ordered by IMember.Name.
name string
The name to search for.

Returns

T
The member with the specified name, or null if not found.

Remarks

This method uses binary search to efficiently locate a member in a sorted collection. The input collection must be ordered by member name using ordinal string comparison; otherwise, results are undefined.