aboutsummaryrefslogtreecommitdiff
path: root/core/strconv
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-03-05 20:34:30 +0000
committergingerBill <bill@gingerbill.org>2020-03-05 20:34:30 +0000
commite92fdb4a99bf9d27009dd35fdd074ff14facfc03 (patch)
treee74c13d12da216f2548db0a8359e491263dc6acd /core/strconv
parent2fe0eaf2adf952867d4ce4fba53b4b3ac75e1ba5 (diff)
`x if cond else y` and `x when cond else y` expressions
Diffstat (limited to 'core/strconv')
-rw-r--r--core/strconv/generic_float.odin4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/strconv/generic_float.odin b/core/strconv/generic_float.odin
index 622dcd044..ad0c51880 100644
--- a/core/strconv/generic_float.odin
+++ b/core/strconv/generic_float.odin
@@ -110,7 +110,7 @@ format_digits :: proc(buf: []byte, shortest: bool, neg: bool, digs: Decimal_Slic
switch fmt {
case 'f', 'F':
- add_bytes(&b, neg ? '-' : '+');
+ add_bytes(&b, '-' if neg else '+');
// integer, padded with zeros when needed
if digs.decimal_point > 0 {
@@ -138,7 +138,7 @@ format_digits :: proc(buf: []byte, shortest: bool, neg: bool, digs: Decimal_Slic
return to_bytes(b);
case 'e', 'E':
- add_bytes(&b, neg ? '-' : '+');
+ add_bytes(&b, '-' if neg else '+');
ch := byte('0');
if digs.count != 0 {