simplify row/lastRow comparison in bulkImport

This commit is contained in:
Matt Jaffee 2019-03-05 12:20:21 -06:00
parent cfb2a80866
commit e54dbd6731
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF

View file

@ -1511,7 +1511,7 @@ func (f *fragment) bulkImportStandard(rowIDs, columnIDs []uint64, options *Impor
// sorting by rowID/columnID first and avoiding the map allocation here. (we
// could reuse rowIDs to store the list of unique row IDs)
rowSet := make(map[uint64]struct{})
lastRowID := uint64(0)
lastRowID := uint64(1 << 63)
// replace columnIDs with calculated positions to avoid allocation.
for i := 0; i < len(columnIDs); i++ {
@ -1523,7 +1523,7 @@ func (f *fragment) bulkImportStandard(rowIDs, columnIDs []uint64, options *Impor
columnIDs[i] = pos
// Add row to rowSet.
if i == 0 || rowID != lastRowID {
if rowID != lastRowID {
lastRowID = rowID
rowSet[rowID] = struct{}{}
}