Michel Hermier
Michel Hermier
You optimized version can optimized a little bit more with: `while (n != 0)`and removing: `if (n == 0) break`.
Please open a separate discussion for this, it can be optimized more than that.
For reference, can you benchmark the algorithm provided by `List`, and the Hoare applied to it (It should optimize a little bit more, because functional is a little bit sub-optimal...
By having the preconditions of `count > 1` are the conditions `low >= 0 && high >= 0` not always true and could be removed?
You can implement `compareTo` in C for better performance and to handle handle BOM prelude. But I would go optimize even furzer, and directly use `strcmp`. Since regular UTF-8 encoding...
Thinking at it again we might need to use `memcmp` instead. Since `String`s known their size and since `\0` is a legal UTF-8 char, I think it is a better...
I would compact it a little bit more. I would: - Remove the happy path `(len1==len2)`, It would need some benchmark on real use cases to prove it is really...
We can use something more compact, by doing something like: ```C // Use a variation of https://graphics.stanford.edu/~seander/bithacks.html#CopyIntegerSign #define intcmp(a, b) (((a) > (b)) - ((a) < (b))) RETURN_NUM(res != 0...
About the ease of read, it is subjective. My solution at least express the intent in code, so I find it simpler than reading comments. But it is a minor...
As you said: `Tuples are generally immutable`. It is not a requirement, but more a trend towards immutability. So I choose not to follow that trends, because it doesn't make...