diff options
| author | Tyge Løvset <[email protected]> | 2023-02-18 07:51:44 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-02-18 07:51:44 +0100 |
| commit | 0e3d07dbd991c1f1a691b24655c37ddab660a9d9 (patch) | |
| tree | dc9801e2fc9f62cbe3eb32cc8897c65e3f25f78b /misc/examples/music_arc.c | |
| parent | c4ae61de5be08e719e3183f4e2d1115c11856796 (diff) | |
| download | STC-modified-0e3d07dbd991c1f1a691b24655c37ddab660a9d9.tar.gz STC-modified-0e3d07dbd991c1f1a691b24655c37ddab660a9d9.zip | |
Fixed carc, cbox: no need for no_lookup and no_eq: use only no_cmp, no_hash if needed.
Diffstat (limited to 'misc/examples/music_arc.c')
| -rw-r--r-- | misc/examples/music_arc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/misc/examples/music_arc.c b/misc/examples/music_arc.c index 2a2d24c5..fcd24beb 100644 --- a/misc/examples/music_arc.c +++ b/misc/examples/music_arc.c @@ -11,6 +11,8 @@ typedef struct int Song_cmp(const Song* x, const Song* y) { return cstr_cmp(&x->title, &y->title); } +uint64_t Song_hash(const Song* x) { return cstr_hash(&x->title); } + Song Song_make(const char* artist, const char* title) { return (Song){cstr_from(artist), cstr_from(title)}; } @@ -22,7 +24,7 @@ void Song_drop(Song* s) { // Define the reference counted type #define i_type SongArc #define i_valclass Song -#define i_opt c_no_hash +//#define i_opt c_no_hash #include <stc/carc.h> // ... and a vector of it |
