mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-11-08 03:00:26 +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 {
|
||||
// Returns next block.
|
||||
// error is NoMoreBlocksErr if it run out of blocks.
|
||||
Next() (Block, error)
|
||||
Next(*Block) error
|
||||
Close() error
|
||||
}
|
||||
|
||||
BlockConsumer interface {
|
||||
Consume(Block) error
|
||||
Consume(*Block) error
|
||||
Close() error
|
||||
}
|
||||
)
|
||||
|
|
|
@ -44,7 +44,7 @@ func (ldbc *LevelDBBlockConsumer) Close() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (ldbc *LevelDBBlockConsumer) Consume(block Block) (err error) {
|
||||
func (ldbc *LevelDBBlockConsumer) Consume(block *Block) (err error) {
|
||||
var encodedKey []byte
|
||||
if encodedKey, err = ldbc.encoder(ldbc.joiner(block.Coord)); err != nil {
|
||||
return
|
||||
|
|
|
@ -49,7 +49,7 @@ func NewSQLiteBlockProducer(path string, splitter common.KeySplitter) (sbp *SQLi
|
|||
return
|
||||
}
|
||||
|
||||
func (sbp *SQLiteBlockProducer) Next() (block Block, err error) {
|
||||
func (sbp *SQLiteBlockProducer) Next(block *Block) (err error) {
|
||||
if sbp.rows == nil {
|
||||
err = NoMoreBlocksErr
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user