Uh oh!
There was an error while loading. Please reload this page.
ComptimeStringMap improvements - #5520
Conversation
squeek502
commented
Jun 19, 2020
I'm presuming the usual 'what about unicode' might apply here. |
By the way, case insensitive Out of curiosity, are there any existing functions that deal with case insensitivity outside of |
data-man
commented
Jun 29, 2020
It's inefficient. |
squeek502
commented
Jun 29, 2020
True. Maybe ComptimeStringMap should be more like the HashMap implementation and take an |
data-man
commented
Jun 29, 2020
Good idea! pubfngetSuperFlexible(str: []constu8, eql: fn (a: var, b: var) bool) ?VpubfnhasSuperFlexible(str: []constu8, eql: fn (a: var, b: var) bool) bool |
data-man
commented
Jul 4, 2020
Added: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
data-man
commented
Jul 4, 2020
Now you can compare keys any way you want. :) |
Hmm, if (kv.key.len!=str.len)
returnnull;Keys can have different lengths, but can be equal with your comparison function (normalization, casing, etc.). |
squeek502
commented
Jul 4, 2020
Yeah, this implementation is heavily reliant on lengths being a short-circuit for inequality. For more robust/complex equality checks, something like ComptimeHashMap is probably better. See also what I wrote in the PR for ComptimeStringMap:
|
data-man
commented
Jul 4, 2020
So I think |
andrewrk
commented
Sep 10, 2020
This has been WIP since June (the freebsd test failures look legitimate), please re-open if you wish to continue working on this. |
Useful for HTML entities, tags, color names, etc.