Bugfix: unique()ing the list of links
That should happen _after_ they are all in the same format. This commit introduces overhead, as we clone() each string here for comparison and that should clearly be fixed. Though the bug-fix is more important at this point.
This commit is contained in:
parent
584ac3d46e
commit
40014051ec
1 changed files with 6 additions and 1 deletions
|
@ -100,8 +100,13 @@ impl InternalLinker for Entry {
|
||||||
fn links_into_values(links: Vec<StoreId>) -> Vec<Result<Value>> {
|
fn links_into_values(links: Vec<StoreId>) -> Vec<Result<Value>> {
|
||||||
links
|
links
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.unique()
|
|
||||||
.map(|s| s.without_base().to_str().map_err_into(LEK::InternalConversionError))
|
.map(|s| s.without_base().to_str().map_err_into(LEK::InternalConversionError))
|
||||||
|
.unique_by(|entry| {
|
||||||
|
match entry {
|
||||||
|
&Ok(ref e) => Some(e.clone()),
|
||||||
|
&Err(_) => None,
|
||||||
|
}
|
||||||
|
})
|
||||||
.map(|elem| elem.map(Value::String))
|
.map(|elem| elem.map(Value::String))
|
||||||
.sorted_by(|a, b| {
|
.sorted_by(|a, b| {
|
||||||
match (a, b) {
|
match (a, b) {
|
||||||
|
|
Loading…
Reference in a new issue