mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Merge pull request #21 from grafana/reuse-expand-postings-method-in-new-postings-cloner
Use `ExpandPostings()` in `NewPostingsCloner()`
This commit is contained in:
commit
fbd1b4fb84
|
@ -807,11 +807,8 @@ type PostingsCloner struct {
|
|||
// The instance provided shouldn't have been used before (no Next() calls should have been done)
|
||||
// and it shouldn't be used once provided to the PostingsCloner.
|
||||
func NewPostingsCloner(p Postings) *PostingsCloner {
|
||||
var ids []uint64
|
||||
for p.Next() {
|
||||
ids = append(ids, p.At())
|
||||
}
|
||||
return &PostingsCloner{ids: ids, err: p.Err()}
|
||||
ids, err := ExpandPostings(p)
|
||||
return &PostingsCloner{ids: ids, err: err}
|
||||
}
|
||||
|
||||
// Clone returns another independent Postings instance.
|
||||
|
|
Loading…
Reference in a new issue