Skip to content

Commit

Permalink
Optimize exit check in sync_json for better efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
nullchinchilla committed Aug 13, 2024
1 parent 7379339 commit aa6f420
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub async fn sync_json(opt: SyncOpt) -> anyhow::Result<String> {
signing_key: hex::encode(exit.0.as_bytes()),
country_code: exit.1.country.alpha2().into(),
city_code: exit.1.city.clone(),
allowed_levels: if free_exits.all_exits.contains(&exit) {
allowed_levels: if free_exits.all_exits.iter().map(|fe| fe.0).any(|fe| fe == exit.0) {
vec!["free".to_string(), "plus".to_string()]
} else {
vec!["plus".to_string()]
Expand Down

0 comments on commit aa6f420

Please sign in to comment.