Skip to content

Commit

Permalink
Remove cast.
Browse files Browse the repository at this point in the history
  • Loading branch information
notbdu committed Feb 11, 2019
1 parent 0bce519 commit 01a61b2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions values/decoding/string_decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,7 @@ func tryDecodeStringDictionary(
if err != nil {
return 0, err
}
// Close the underlying reader if it satisifies the `io.ReadCloser` iface.
rc, ok := reader.(io.ReadCloser)
if ok {
// NB(bodu): We don't need to propagate `Close` errors back up because there aren't any.
// We have two types of string readers. A bytes reader and a compress reader. The bytes reader
// doesn't implement the `io.Closer` iface and the compress reader has no errors when calling `Close`.
defer rc.Close()
}
defer reader.Close()
bytesRead, err := xproto.DecodeStringArray(reader, stringArrayProto, decodeBuf)
if err != nil {
return 0, err
Expand Down

0 comments on commit 01a61b2

Please sign in to comment.