We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e6ea3b commit aa43630Copy full SHA for aa43630
1 file changed
store/postgres/src/dynds/private.rs
@@ -331,17 +331,14 @@ struct ManifestIdxMap {
331
332
impl ManifestIdxMap {
333
fn new(src: &[(i32, String)], dst: &[(i32, String)]) -> Self {
334
+ let dst_idx_map: HashMap<&String, i32> =
335
+ HashMap::from_iter(dst.iter().map(|(idx, name)| (name, *idx)));
336
let map = src
337
.iter()
338
.map(|(src_idx, src_name)| {
339
(
340
*src_idx,
- (
- dst.iter()
341
- .find(|(_, dst_name)| src_name == dst_name)
342
- .map(|(dst_idx, _)| *dst_idx),
343
- src_name.to_string(),
344
- ),
+ (dst_idx_map.get(src_name).copied(), src_name.to_string()),
345
)
346
})
347
.collect();
0 commit comments