diff options
| author | Tyge Løvset <[email protected]> | 2021-01-17 13:40:25 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-01-17 13:40:25 +0100 |
| commit | 8fa2b30172ac7126167889021779ceeee7e90f42 (patch) | |
| tree | fd02b80b5fa275b276fd8d8cacc783575a4b1268 | |
| parent | e13d9b07244beef4ae5bba739d90d2bcd2a5d9ac (diff) | |
| parent | 96384f6e607998872db4e4eedcf7899c3f510d6d (diff) | |
| download | STC-modified-8fa2b30172ac7126167889021779ceeee7e90f42.tar.gz STC-modified-8fa2b30172ac7126167889021779ceeee7e90f42.zip | |
Merge branch 'master' of https://github.com/tylo-work/C99Containers into master
| -rw-r--r-- | docs/csmap_api.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/csmap_api.md b/docs/csmap_api.md index dbb71fc7..c4f6c0c4 100644 --- a/docs/csmap_api.md +++ b/docs/csmap_api.md @@ -181,8 +181,8 @@ Demonstrate csmap with plain-old-data key type Vec3i and int as mapped type: csm typedef struct { int x, y, z; } Vec3i; static int Vec3i_compare(const Vec3i* a, const Vec3i* b) { - if (a->x != b->x) return c_default_compare(&a->x, &b->x); - if (a->y != b->y) return c_default_compare(&a->y, &b->y); + if (a->x != b->x) return 1 - ((a->x < b->x)<<1); + if (a->y != b->y) return 1 - ((a->y < b->y)<<1); return c_default_compare(&a->z, &b->z); } |
