This commit is contained in:
Andras Schmelczer 2026-05-12 22:00:56 +01:00
parent 8708bf000d
commit 11711c57e6
38 changed files with 5361 additions and 265 deletions

View file

@ -287,7 +287,7 @@ pub async fn get_export(
}
// Sort by property count descending
postcode_aggs.sort_unstable_by(|lhs, rhs| rhs.1.count.cmp(&lhs.1.count));
postcode_aggs.sort_unstable_by_key(|agg| std::cmp::Reverse(agg.1.count));
// Sample if too many postcodes
let was_sampled = postcode_aggs.len() > MAX_EXPORT_POSTCODES;
@ -307,7 +307,7 @@ pub async fn get_export(
postcode_aggs.swap(pick, swap_idx);
}
postcode_aggs.truncate(MAX_EXPORT_POSTCODES);
postcode_aggs.sort_unstable_by(|lhs, rhs| rhs.1.count.cmp(&lhs.1.count));
postcode_aggs.sort_unstable_by_key(|agg| std::cmp::Reverse(agg.1.count));
}
// Determine column order: filter features first, then remaining