Skip to content

Commit 3f77f69

Browse files
committed
Simplify buffer assignment with logically equivalent control flow
1 parent 2f46263 commit 3f77f69

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cmd/micro/micro.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,9 @@ func LoadInput(args []string) []*buffer.Buffer {
240240
screen.TermMessage("Error reading from stdin: ", err)
241241
input = []byte{}
242242
}
243-
buffers = append(buffers, buffer.NewBufferFromStringWithCommand(string(input), filename, btype, command))
244-
} else {
245-
// Option 3, just open an empty buffer
246-
buffers = append(buffers, buffer.NewBufferFromStringWithCommand(string(input), filename, btype, command))
247243
}
244+
// Open either stdin (Option 2) or an empty buffer (Option 3)
245+
buffers = append(buffers, buffer.NewBufferFromStringWithCommand(string(input), filename, btype, command))
248246
}
249247

250248
return buffers

0 commit comments

Comments
 (0)