Table of Contents

Method InsertOrdered

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

InsertOrdered<T>(List<T>, T, IComparer<T>?)

Inserts an item into an already sorted list.

public static int InsertOrdered<T>(this List<T> sortedList, T item, IComparer<T>? comparer = null)

Parameters

sortedList List<T>

The sorted list.

item T

The item to insert.

comparer IComparer<T>

A custom comparer to use when comparing the item against elements in the collection.

Returns

int

Type Parameters

T

The type of item to insert.