linearSearch

fun MutableEventIdentifierGapBuffer.linearSearch(value: EventIdentifier): Int

Returns the insertion index for the given EventIdentifier. The insertion index can be seen as the index at which the cursor should be moved when inserting an event with the given sequence number and site identifier that would preserve the sorted behavior of the buffer.

Return

the insertion index, between 0 and MutableEventIdentifierGapBuffer.size

See also

Parameters

value

the EventIdentifier we would insert.


fun MutableIntGapBuffer.linearSearch(value: Int): Int

Returns the insertion index for the given Int. The insertion index can be seen as the index at which the cursor should be moved when inserting an event with the given sequence number and site identifier that would preserve the sorted behavior of the buffer.

Return

the insertion index, between 0 and MutableIntGapBuffer.size

See also

a binary search equivalent

Parameters

value

the Int we would insert.