@actyx/sdk
Version:
Actyx SDK
16 lines (15 loc) • 699 B
TypeScript
/**
* In place merge sort of two ordered arrays. After calling this method, out
* will be properly ordered according to ord.
*
* @param l array sorted according to ord. Will not be modified!
* @param r array sorted according to ord. Will not be modified!
* @param out array containing a concatenation of l and r. Will be modified in place!
* @param ord order for l, r and out
*
* @returns the highest index at which out did not have to be changed
*/
export declare function mergeSortedInto<K>(l: ReadonlyArray<K>, // original events
r: ReadonlyArray<K>, // new events
out: K[], // original events concatenated with new events, to be modified in place
ord: (a: K, b: K) => number): number;