mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-05 22:32:20 +01:00
lib/storage: use better naming for a function returning new []rawRows - newRawRowsBlock() -> newRawRows()
This commit is contained in:
parent
e01f52d517
commit
0c90b49e4b
@ -497,7 +497,7 @@ func (rrs *rawRowsShard) addRows(pt *partition, rows []rawRow) []rawRow {
|
|||||||
|
|
||||||
rrs.mu.Lock()
|
rrs.mu.Lock()
|
||||||
if cap(rrs.rows) == 0 {
|
if cap(rrs.rows) == 0 {
|
||||||
rrs.rows = newRawRowsBlock()
|
rrs.rows = newRawRows()
|
||||||
}
|
}
|
||||||
n := copy(rrs.rows[len(rrs.rows):cap(rrs.rows)], rows)
|
n := copy(rrs.rows[len(rrs.rows):cap(rrs.rows)], rows)
|
||||||
rrs.rows = rrs.rows[:len(rrs.rows)+n]
|
rrs.rows = rrs.rows[:len(rrs.rows)+n]
|
||||||
@ -524,7 +524,7 @@ type rawRowsBlock struct {
|
|||||||
rows []rawRow
|
rows []rawRow
|
||||||
}
|
}
|
||||||
|
|
||||||
func newRawRowsBlock() []rawRow {
|
func newRawRows() []rawRow {
|
||||||
n := getMaxRawRowsPerShard()
|
n := getMaxRawRowsPerShard()
|
||||||
return make([]rawRow, 0, n)
|
return make([]rawRow, 0, n)
|
||||||
}
|
}
|
||||||
@ -533,7 +533,7 @@ func getRawRowsBlock() *rawRowsBlock {
|
|||||||
v := rawRowsBlockPool.Get()
|
v := rawRowsBlockPool.Get()
|
||||||
if v == nil {
|
if v == nil {
|
||||||
return &rawRowsBlock{
|
return &rawRowsBlock{
|
||||||
rows: newRawRowsBlock(),
|
rows: newRawRows(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return v.(*rawRowsBlock)
|
return v.(*rawRowsBlock)
|
||||||
|
Loading…
Reference in New Issue
Block a user