Documentation ¶
Overview ¶
Package xsort contains manually inlined versions of the "search wrappers" in the standard sort library.
In the standard library, these are convenience wrappers around the generic `sort.Search()` function, which takes a function parameter to determine truthfulness. However, since this function is utilized within a for loop, it cannot currently be inlined by the Go compiler, resulting in non-trivial performance overhead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SearchFloat64s ¶
SearchFloat64s searches for x in a sorted slice of float64s and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.
func SearchInts ¶
SearchInts searches for x in a sorted slice of ints and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.
func SearchStrings ¶
SearchStrings searches for x in a sorted slice of strings and returns the index as specified by Search. The return value is the index to insert x if x is not present (it could be len(a)). The slice must be sorted in ascending order.
Types ¶
This section is empty.