commit d96b3d1bdccaee8a62716e706bd722d0df5d86c4 parent 23267a7d5cb63bdc51d46b3e2720ebc4ebb625aa Author: Byron Torres <b@torresjrjr.com> Date: Sun, 19 Feb 2023 18:16:56 +0000 simplifiy cmd_edit() Diffstat:
M | command.ha | | | 8 | +++----- |
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/command.ha b/command.ha @@ -206,12 +206,10 @@ fn cmd_edit(s: *session, cmd: *command) (void | error) = { const fname = if (len(cmd.arg) != 0) { s.buf.filename = cmd.arg; yield cmd.arg; + } else if (len(s.buf.filename) != 0) { + yield s.buf.filename; } else { - yield if (len(s.buf.filename) != 0) { - yield s.buf.filename; - } else { - return nofilename; - }; + return nofilename; }; const h = match (os::open(fname)) {