Skip to content

Commit

Permalink
Apply minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
reinterpretcat committed Jun 4, 2024
1 parent d8f9784 commit 84a9c6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ are already published. So, I stick to it for now.
* tweak job index
* tweak infeasible search heuristic
* refactor route intervals and multi trip enablers
* refactor feature objective


## [v1.23.0]- 2023-12-22
Expand Down
7 changes: 2 additions & 5 deletions vrp-core/src/models/goal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,9 @@ pub struct GoalContextBuilder {
impl GoalContextBuilder {
/// Creates a `GoalBuilder` with the given list of features.
pub fn with_features(features: Vec<Feature>) -> GenericResult<Self> {
let ids_all = features
.iter()
.filter_map(|feature| feature.objective.as_ref().map(|_| feature.name.clone()))
.collect::<Vec<_>>();

let ids_all = features.iter().map(|feature| feature.name.clone()).collect::<Vec<_>>();
let ids_unique = ids_all.iter().collect::<HashSet<_>>();

if ids_unique.len() != ids_all.len() {
return Err(format!(
"some of the features are defined more than once, check ids list: {}",
Expand Down

0 comments on commit 84a9c6c

Please sign in to comment.