Add some comments

This commit is contained in:
Clément Renault 2024-11-12 10:53:50 +01:00
parent 745bcaa23d
commit 5e12a83ae8
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -94,6 +94,7 @@ impl<'pl> DocumentOperation<'pl> {
while let Some(document) =
iter.next().transpose().map_err(UserError::SerdeJson)?
{
// TODO Do not allocate when it is not necessary
let external_document_id = primary_key.extract_fields_and_docid(
document,
new_fields_ids_map,
@ -198,6 +199,7 @@ impl<'pl> DocumentOperation<'pl> {
};
// And finally sort them
// TODO Can we sort in parallel?
docids_version_offsets.sort_unstable_by_key(|(_, (_, docops))| sort_function_key(docops));
let docids_version_offsets = docids_version_offsets.into_bump_slice();
Ok(DocumentOperationChanges {