mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-02 02:55:35 +00:00
add a version of array_pod_sort that takes a custom comparator function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88861 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
93f9f7a440
commit
9806f833a6
@ -270,6 +270,14 @@ static inline void array_pod_sort(IteratorTy Start, IteratorTy End) {
|
||||
get_array_pad_sort_comparator(*Start));
|
||||
}
|
||||
|
||||
template<class IteratorTy>
|
||||
static inline void array_pod_sort(IteratorTy Start, IteratorTy End,
|
||||
int (*Compare)(const void*, const void*)) {
|
||||
// Don't dereference start iterator of empty sequence.
|
||||
if (Start == End) return;
|
||||
qsort(&*Start, End-Start, sizeof(*Start), Compare);
|
||||
}
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user