Skip to content

Commit

Permalink
Change empty string checks to be more idiomatic (valyala#1684)
Browse files Browse the repository at this point in the history
  • Loading branch information
Max-Cheng committed Feb 12, 2024
1 parent e2c29a6 commit 88dff59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func (fs *FS) initRequestHandler() {
}

compressedFileSuffixes := fs.CompressedFileSuffixes
if len(compressedFileSuffixes["br"]) == 0 || len(compressedFileSuffixes["gzip"]) == 0 ||
if compressedFileSuffixes["br"] == "" || compressedFileSuffixes["gzip"] == "" ||
len(compressedFileSuffixes["zstd"]) == 0 || compressedFileSuffixes["br"] == compressedFileSuffixes["gzip"] ||
compressedFileSuffixes["br"] == compressedFileSuffixes["zstd"] ||
compressedFileSuffixes["gzip"] == compressedFileSuffixes["zstd"] {
Expand Down
2 changes: 1 addition & 1 deletion header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2335,7 +2335,7 @@ type bufioPeekReader struct {
}

func (r *bufioPeekReader) Read(b []byte) (int, error) {
if len(r.s) == 0 {
if r.s == "" {
return 0, io.EOF
}

Expand Down

0 comments on commit 88dff59

Please sign in to comment.