basestore: Refactor scan primitives
Created by: efritz
This PR propose adding NewSliceScanner
and NewFirstScanner
as the primitives of basestore scanner factories. See the reduction of usage within the file, and also see a sample usage in enterprise/internal/codeintel/stores/dbstore/uploads.go
, which we replicate incrementally through the rest of the codebase.
Test plan
Compiler and existing unit tests.