Skip to content

Commit

Permalink
refactor: remove redundant nil check in flush (#812)
Browse files Browse the repository at this point in the history
From the Go docs:

  "If the map is nil, the number of iterations is 0." [1]

Therefore, an additional nil check for before the loop is unnecessary.

[1]: https://go.dev/ref/spec#For_range

Signed-off-by: Eng Zer Jun <[email protected]>
  • Loading branch information
Juneezee authored Aug 24, 2023
1 parent b5e2519 commit 12f4057
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions standard_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,8 @@ func (r *standardRenderer) flush() {

// Merge the set of lines we're skipping as a rendering optimization with
// the set of lines we've explicitly asked the renderer to ignore.
if r.ignoreLines != nil {
for k, v := range r.ignoreLines {
skipLines[k] = v
}
for k, v := range r.ignoreLines {
skipLines[k] = v
}

// Paint new lines
Expand Down

0 comments on commit 12f4057

Please sign in to comment.