Add a code comment, as suggested in PR review

Co-authored-by: Many the fish <many@meilisearch.com>
This commit is contained in:
Loïc Lecrenier 2022-07-20 16:20:35 +02:00 committed by GitHub
parent fc9f3f31e7
commit 41a0ce07cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,6 +97,7 @@ impl<W: Write> DocumentsBatchBuilder<W> {
.map(|(k, t)| (self.fields_index.insert(k), t)) .map(|(k, t)| (self.fields_index.insert(k), t))
.enumerate() .enumerate()
.collect(); .collect();
// Make sure that we insert the fields ids in order as the obkv writer has this requirement.
typed_fields_ids.sort_unstable_by_key(|(_, (fid, _))| *fid); typed_fields_ids.sort_unstable_by_key(|(_, (fid, _))| *fid);
let mut record = csv::StringRecord::new(); let mut record = csv::StringRecord::new();