diff options
| author | Tyge Løvset <[email protected]> | 2021-01-17 13:27:06 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-01-17 13:27:06 +0100 |
| commit | 96384f6e607998872db4e4eedcf7899c3f510d6d (patch) | |
| tree | b90d7e34955df1474024a99a54204b861539007a /docs/csmap_api.md | |
| parent | 19aa4243bbf59cecb348541495b9e7abe04777ef (diff) | |
| download | STC-modified-96384f6e607998872db4e4eedcf7899c3f510d6d.tar.gz STC-modified-96384f6e607998872db4e4eedcf7899c3f510d6d.zip | |
Update csmap_api.md
Diffstat (limited to 'docs/csmap_api.md')
| -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); } |
