Merge: lib/core: remove uses of Byte for Text
authorJean Privat <jean@pryen.org>
Fri, 8 Jun 2018 22:42:33 +0000 (18:42 -0400)
committerJean Privat <jean@pryen.org>
Fri, 8 Jun 2018 22:42:33 +0000 (18:42 -0400)
commitcc82ab7db09e689a51590cc103c16f7034759f8d
tree2f65f2cd93d73ea7be4621b00ed48cb0c25e1ad1
parent1c4b26e77cc6884d7ef4bb7c98f0a54c7e021de5
parenta805fd5fa850a6e3ccd50c6ee29e3530edb8c90e
Merge: lib/core: remove uses of Byte for Text

Byte is convenient for automatic modular arithmetic on 8-bit values.

However, due to the way our Numeric types are handled, no automatic
conversion is done when working on primitive types, and operations like
comparison will fail when comparing two values of different type.

This is a cause of bugs as the u8 suffix is requires for comparing two
bytes, and is also the cause for tedious cast operations to go
back-and-forth between Byte and Int.

We remove the uses of Byte in the Text API, and replace then with Int.
This should not have a negative impact on performance.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

Pull-Request: #2688
lib/core/text/abstract_text.nit