Add the max_weight of the weight map if it's lacking

This commit is contained in:
ManyTheFish
2025-03-06 13:58:28 +01:00
parent ca41ce3bbd
commit 5ceddbda84
2 changed files with 7 additions and 8 deletions

View File

@ -48,11 +48,6 @@ impl FieldidsWeightsMap {
self.map.values().copied().max()
}
/// Returns the field id with the highest weight.
pub fn max_weight_fid(&self) -> Option<(FieldId, Weight)> {
self.map.iter().max_by_key(|(_, weight)| *weight).map(|(fid, weight)| (*fid, *weight))
}
/// Return an iterator visiting all field ids in arbitrary order.
pub fn ids(&self) -> impl Iterator<Item = FieldId> + '_ {
self.map.keys().copied()