Skip to content

Commit b283b4e

Browse files
committed
deduplicate indices on insertion
1 parent 4002bdc commit b283b4e

File tree

1 file changed

+1
-1
lines changed
  • crates/storage/provider/src/providers/database

1 file changed

+1
-1
lines changed

crates/storage/provider/src/providers/database/provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ impl<TX: DbTxMut + DbTx> DatabaseProvider<TX> {
780780
for (partial_key, indices) in index_updates {
781781
let last_shard = self.take_shard::<T>(sharded_key_factory(partial_key, u64::MAX))?;
782782
// chunk indices and insert them in shards of N size.
783-
let indices = last_shard.iter().chain(indices.iter());
783+
let indices = last_shard.iter().chain(indices.iter()).dedup();
784784
let chunks = indices
785785
.chunks(sharded_key::NUM_OF_INDICES_IN_SHARD)
786786
.into_iter()

0 commit comments

Comments
 (0)