mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-11 09:20:17 +01:00
Do not pass Block structs around only pointers.
This commit is contained in:
parent
02ada38090
commit
8f4a558234
@ -19,14 +19,13 @@ type (
|
|||||||
}
|
}
|
||||||
|
|
||||||
BlocKProducer interface {
|
BlocKProducer interface {
|
||||||
// Returns next block.
|
|
||||||
// error is NoMoreBlocksErr if it run out of blocks.
|
// error is NoMoreBlocksErr if it run out of blocks.
|
||||||
Next() (Block, error)
|
Next(*Block) error
|
||||||
Close() error
|
Close() error
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockConsumer interface {
|
BlockConsumer interface {
|
||||||
Consume(Block) error
|
Consume(*Block) error
|
||||||
Close() error
|
Close() error
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -44,7 +44,7 @@ func (ldbc *LevelDBBlockConsumer) Close() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ldbc *LevelDBBlockConsumer) Consume(block Block) (err error) {
|
func (ldbc *LevelDBBlockConsumer) Consume(block *Block) (err error) {
|
||||||
var encodedKey []byte
|
var encodedKey []byte
|
||||||
if encodedKey, err = ldbc.encoder(ldbc.joiner(block.Coord)); err != nil {
|
if encodedKey, err = ldbc.encoder(ldbc.joiner(block.Coord)); err != nil {
|
||||||
return
|
return
|
||||||
|
@ -49,7 +49,7 @@ func NewSQLiteBlockProducer(path string, splitter common.KeySplitter) (sbp *SQLi
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sbp *SQLiteBlockProducer) Next() (block Block, err error) {
|
func (sbp *SQLiteBlockProducer) Next(block *Block) (err error) {
|
||||||
if sbp.rows == nil {
|
if sbp.rows == nil {
|
||||||
err = NoMoreBlocksErr
|
err = NoMoreBlocksErr
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user