# optionallyReverse

fun < T > Iterable < T >. optionallyReverse (reverse: Boolean ): Iterable < T >(source)

Optionally reverses this Iterable based on the reverse parameter. Delegates to specialized implementations for List and Set for better performance.

#### Return

The iterable, optionally reversed

#### Parameters

reverse

If true, reverses the iterable; otherwise returns it unchanged

#### Type Parameters

T

The type of items in the iterable

fun < T > List < T >. optionallyReverse (reverse: Boolean ): List < T >(source)

Optionally reverses this List based on the reverse parameter.

#### Return

The list, optionally reversed

#### Parameters

reverse

If true, reverses the list; otherwise returns it unchanged

#### Type Parameters

T

The type of items in the list

fun < T > Set < T >. optionallyReverse (reverse: Boolean ): Set < T >(source)

Optionally reverses this Set based on the reverse parameter. Note that the resulting set may have a different iteration order than the original.

#### Return

The set, optionally reversed

#### Parameters

reverse

If true, reverses the set; otherwise returns it unchanged

#### Type Parameters

T

The type of items in the set

inline fun < T > Array < T >. optionallyReverse (reverse: Boolean ): Array < T >(source)

Optionally reverses this Array based on the reverse parameter.

#### Return

The array, optionally reversed

#### Parameters

reverse

If true, creates a reversed copy of the array; otherwise returns it unchanged

#### Type Parameters

T

The type of items in the array

fun Pagination . optionallyReverse (objectsCount: Int , reverse: Boolean ): Pagination (source)
fun Pagination . optionallyReverse (objectsCount: Long , reverse: Boolean ): Pagination (source)