aboutsummaryrefslogtreecommitdiff
path: root/src/integer128.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-06-08 12:37:07 +0100
committerGinger Bill <bill@gingerbill.org>2017-06-08 12:37:07 +0100
commit13deb4706c37acbababc6f60a1b6ec58c630a3f5 (patch)
tree764e98b0b49f111fd8a33ae5cc3a80070e1a0231 /src/integer128.cpp
parent9b61adb97dd78e1cf04ad410e72166f684f97925 (diff)
Update `String` to use overloading
Diffstat (limited to 'src/integer128.cpp')
-rw-r--r--src/integer128.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/integer128.cpp b/src/integer128.cpp
index 7682ae56c..39d834ab3 100644
--- a/src/integer128.cpp
+++ b/src/integer128.cpp
@@ -109,8 +109,8 @@ u128 u128_from_string(String string) {
// TODO(bill): Allow for numbers with underscores in them
u64 base = 10;
bool has_prefix = false;
- if (string.len > 2 && string.text[0] == '0') {
- switch (string.text[1]) {
+ if (string.len > 2 && string[0] == '0') {
+ switch (string[1]) {
case 'b': base = 2; has_prefix = true; break;
case 'o': base = 8; has_prefix = true; break;
case 'd': base = 10; has_prefix = true; break;
@@ -160,8 +160,8 @@ i128 i128_from_string(String string) {
// TODO(bill): Allow for numbers with underscores in them
u64 base = 10;
bool has_prefix = false;
- if (string.len > 2 && string.text[0] == '0') {
- switch (string.text[1]) {
+ if (string.len > 2 && string[0] == '0') {
+ switch (string[1]) {
case 'b': base = 2; has_prefix = true; break;
case 'o': base = 8; has_prefix = true; break;
case 'd': base = 10; has_prefix = true; break;