diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-02-18 10:41:48 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-02-18 10:41:48 +0000 |
| commit | d2f9d208330e692f29a2b48dce62a9c5bcab6031 (patch) | |
| tree | 814604ce923e63d8a4c19e9a4c6483e943730597 /core | |
| parent | 71100ed427ee2eec8d8a9d4d9616102738097e80 (diff) | |
Change ternary expression precedence
Diffstat (limited to 'core')
| -rw-r--r-- | core/fmt.odin | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/core/fmt.odin b/core/fmt.odin index 22e7eddd4..6c6beb3ab 100644 --- a/core/fmt.odin +++ b/core/fmt.odin @@ -116,11 +116,7 @@ buffer_write_type :: proc(buf: ^Buffer, ti: ^Type_Info) { case ti == type_info(int): buffer_write_string(buf, "int"); case ti == type_info(uint): buffer_write_string(buf, "uint"); default: - if info.signed { - buffer_write_string(buf, "i"); - } else { - buffer_write_string(buf, "u"); - } + buffer_write_string(buf, info.signed ? "i" : "u"); fi := Fmt_Info{buf = buf}; fmt_int(^fi, cast(u64)(8*info.size), false, 'd'); } @@ -396,11 +392,7 @@ fmt_bad_verb :: proc(using fi: ^Fmt_Info, verb: rune) { fmt_bool :: proc(using fi: ^Fmt_Info, b: bool, verb: rune) { match verb { case 't', 'v': - if b { - buffer_write_string(buf, "true"); - } else { - buffer_write_string(buf, "false"); - } + buffer_write_string(buf, b ? "true" : "false"); default: fmt_bad_verb(fi, verb); } |