refactor: remove redundant nil check in `flush` (#812)

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 <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun 2023-08-25 00:17:44 +08:00 committed by GitHub
parent b5e2519fea
commit 12f405723d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -208,10 +208,8 @@ func (r *standardRenderer) flush() {
// Merge the set of lines we're skipping as a rendering optimization with // 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. // the set of lines we've explicitly asked the renderer to ignore.
if r.ignoreLines != nil { for k, v := range r.ignoreLines {
for k, v := range r.ignoreLines { skipLines[k] = v
skipLines[k] = v
}
} }
// Paint new lines // Paint new lines