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:
Matthias Beyer 2016-09-06 10:56:23 +02:00
parent 584ac3d46e
commit 40014051ec

View file

@ -100,8 +100,13 @@ impl InternalLinker for Entry {
fn links_into_values(links: Vec<StoreId>) -> Vec<Result<Value>> {
links
.into_iter()
.unique()
.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))
.sorted_by(|a, b| {
match (a, b) {