Use for_each instead of fold.
This commit is contained in:
parent
3082028be3
commit
1d6723a77a
1 changed files with 2 additions and 2 deletions
|
@ -135,7 +135,7 @@ where
|
||||||
) {
|
) {
|
||||||
let point = self.elements.point_from_location(location);
|
let point = self.elements.point_from_location(location);
|
||||||
// Use internal iterator manually as it is much more efficient.
|
// Use internal iterator manually as it is much more efficient.
|
||||||
state.iter().fold((), |(), node| {
|
state.iter().for_each(|node| {
|
||||||
self.values.insert(node, point);
|
self.values.insert(node, point);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ where
|
||||||
) {
|
) {
|
||||||
let point = self.elements.point_from_location(location);
|
let point = self.elements.point_from_location(location);
|
||||||
// Use internal iterator manually as it is much more efficient.
|
// Use internal iterator manually as it is much more efficient.
|
||||||
state.iter().fold((), |(), node| {
|
state.iter().for_each(|node| {
|
||||||
self.values.insert(node, point);
|
self.values.insert(node, point);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue