Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Commit

Permalink
[buffered encoder pool] Check if options are nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerome Froelich committed Aug 28, 2017
1 parent b39083e commit e1d4a58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions protocol/msgpack/buffered_encoder_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ type bufferedEncoderPool struct {

// NewBufferedEncoderPool creates a new pool for buffered encoders.
func NewBufferedEncoderPool(opts BufferedEncoderPoolOptions) BufferedEncoderPool {
if opts == nil {
opts = NewBufferedEncoderPoolOptions()
}
return &bufferedEncoderPool{
maxCapacity: opts.MaxCapacity(),
pool: pool.NewObjectPool(opts.ObjectPoolOptions()),
Expand Down

0 comments on commit e1d4a58

Please sign in to comment.