Skip to content

Commit

Permalink
fixup: combine multipe IFs in parseMediaType method
Browse files Browse the repository at this point in the history
  • Loading branch information
vadzappa committed Oct 18, 2023
1 parent 4ee65c4 commit 2b14009
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions part.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,7 @@ func (p *Part) decodeContent(r io.Reader, readPartErrorPolicy ReadPartErrorPolic

// parses media type using custom or default media type parser
func (p *Part) parseMediaType(ctype string) (mtype string, params map[string]string, invalidParams []string, err error) {
if p.parser == nil {
return ParseMediaType(ctype)
}

if p.parser.customParseMediaType == nil {
if p.parser == nil || p.parser.customParseMediaType == nil {
return ParseMediaType(ctype)
}

Expand Down

0 comments on commit 2b14009

Please sign in to comment.