stupid return mistake fix, and dropped the additional assertion check!

This commit is contained in:
Krasi Georgiev 2018-02-20 13:32:23 +02:00
parent 9b7f0cfa88
commit 933ab8a34e
2 changed files with 3 additions and 5 deletions

View File

@ -82,5 +82,6 @@ func (p *Pool) Put(s interface{}) {
continue
}
p.buckets[i].Put(slice.Slice(0, 0).Interface())
return
}
}

View File

@ -662,11 +662,8 @@ mainLoop:
time.Since(last).Seconds(),
)
}
b, ok := sl.buffers.Get(sl.lastScrapeSize).([]byte)
if !ok {
b = make([]byte, 0, sl.lastScrapeSize)
level.Error(sl.l).Log("msg", "buffer pool type assertion error")
}
b := sl.buffers.Get(sl.lastScrapeSize).([]byte)
buf := bytes.NewBuffer(b)
scrapeErr := sl.scraper.scrape(scrapeCtx, buf)