Skip to content

Commit

Permalink
Merge pull request #153 from aler9/patch/redundant-check
Browse files Browse the repository at this point in the history
Remove redundant conditions in unmarshalSlice()
  • Loading branch information
sunfish-shogi committed Oct 1, 2023
2 parents f2a0cd9 + fb51aa1 commit efaaa51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion marshaller.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func (u *unmarshaller) unmarshalSlice(v reflect.Value, fi *fieldInstance) error
return fmt.Errorf("out of memory: requestedSize=%d", length)
}

if fi.size != 0 && fi.size%8 == 0 && u.rbits%8 == 0 && elemType.Kind() == reflect.Uint8 && fi.size == 8 {
if u.rbits%8 == 0 && elemType.Kind() == reflect.Uint8 && fi.size == 8 {
totalSize := length * uint64(fi.size) / 8
capacity := totalSize
if u.dst.GetType() != BoxTypeMdat() && capacity > maxInitialSliceCapacity {
Expand Down

0 comments on commit efaaa51

Please sign in to comment.