Skip to content

Commit

Permalink
store: filter out vids
Browse files Browse the repository at this point in the history
  • Loading branch information
zorancv authored Feb 20, 2025
1 parent 77b278c commit 3c448de
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions graph/src/data/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -883,13 +883,17 @@ impl Entity {

// This collects the entity into an ordered vector so that it can be iterated deterministically.
pub fn sorted(self) -> Vec<(Word, Value)> {
let mut v: Vec<_> = self.0.into_iter().map(|(k, v)| (k, v)).collect();
let mut v: Vec<_> = self
.0
.into_iter()
.filter(|(k, _)| !k.eq(VID_FIELD))
.collect();
v.sort_by(|(k1, _), (k2, _)| k1.cmp(k2));
v
}

pub fn sorted_ref(&self) -> Vec<(&str, &Value)> {
let mut v: Vec<_> = self.0.iter().collect();
let mut v: Vec<_> = self.0.iter().filter(|(k, _)| !k.eq(&VID_FIELD)).collect();
v.sort_by(|(k1, _), (k2, _)| k1.cmp(k2));
v
}
Expand Down

0 comments on commit 3c448de

Please # to comment.