diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2023-07-29 10:41:57 -0230 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2023-07-29 10:41:57 -0230 |
| commit | 88bf9516752558207bd34c4fec73ce2632c22b2c (patch) | |
| tree | 814aaa9195138aac5388bd84146b2e3dc00b7463 /ui.go | |
| parent | 0e1cd2b6a328887c1a630eae0b34366a607bb1b8 (diff) | |
| download | pfc-88bf9516752558207bd34c4fec73ce2632c22b2c.zip | |
use Stack push, pop methods
Diffstat (limited to 'ui.go')
| -rw-r--r-- | ui.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -58,9 +58,9 @@ func (ui UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if fn := parseFunction(ui.calc.buf); fn != nil { fn(ui.calc.stack) } else if con := parseConstant(ui.calc.buf); con != nil { - ui.calc.stack = append(ui.calc.stack, *con) + ui.calc.stack.push(*con) } else if f, err := strconv.ParseFloat(ui.calc.buf, 64); err == nil { - ui.calc.stack = append(ui.calc.stack, f) + ui.calc.stack.push(f) } ui.calc.buf = "" default: |