go-datastore
go-datastore copied to clipboard
Provide Query Paramater to avoid copying Value's data?
When NextSync() is used it is safe to avoid copying the Value's data. This will help mostly with go-ds-leveldb queries see https://github.com/libp2p/go-libp2p-kad-dht/issues/39.
@whyrusleeping Do you think this is a good idea? If this paramater is provided it will be an error to call either the Next() or Process() methods on the results.
From IRC:
whyrusleeping: kevina: yeah, lets punt on doing the zero-copy values for now whyrusleeping: I definitely want that at some point, but lets not rock the boat too much here whyrusleeping: the reason i'm more hesitant on this one is that misuse of that feature can lead to some pretty subtle bugs