-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use qsort to sort short ByteString (#267)
* Add benchmarks for sorting * Write c_sort, which is a binding to qsort * Use qsort to sort tiny bytestrings * Update cbits/fpstring.c Co-authored-by: Viktor Dukhovni <[email protected]> * Change unsigned long to size_t * Change unsigned long to size_t in return type * Bonus points * Remove clong Co-authored-by: Viktor Dukhovni <[email protected]>
- Loading branch information
Showing
6 changed files
with
54 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
|
||
#include <string.h> | ||
#include <stdlib.h> | ||
|
||
void fps_reverse(unsigned char *dest, unsigned char *from, unsigned long len); | ||
void fps_intersperse(unsigned char *dest, unsigned char *from, unsigned long len, unsigned char c); | ||
unsigned char fps_maximum(unsigned char *p, unsigned long len); | ||
unsigned char fps_minimum(unsigned char *p, unsigned long len); | ||
unsigned long fps_count(unsigned char *p, unsigned long len, unsigned char w); | ||
|
||
void fps_reverse(unsigned char *dest, unsigned char *from, size_t len); | ||
void fps_intersperse(unsigned char *dest, unsigned char *from, size_t len, unsigned char c); | ||
unsigned char fps_maximum(unsigned char *p, size_t len); | ||
unsigned char fps_minimum(unsigned char *p, size_t len); | ||
size_t fps_count(unsigned char *p, size_t len, unsigned char w); | ||
void fps_sort(unsigned char *p, size_t len); |