This commit is contained in:
Ara Sadoyan
2025-02-26 14:42:11 +01:00
parent c3bd2f143e
commit 7589ac27f8
3 changed files with 17 additions and 16 deletions

View File

@@ -1,18 +1,19 @@
use dashmap::DashMap;
use std::sync::atomic::AtomicUsize;
use tokio::sync::{RwLockReadGuard, RwLockWriteGuard};
use tokio::sync::RwLockReadGuard;
/*
#[allow(dead_code)]
pub fn dashmaps(map1: &RwLockWriteGuard<DashMap<String, (Vec<(String, u16)>, AtomicUsize)>>, map2: &DashMap<String, (Vec<(String, u16)>, AtomicUsize)>) -> bool {
if map1.len() != map2.len() {
return false; // Different number of keys
return false;
}
for entry1 in map1.iter() {
let key = entry1.key();
let (vec1, _) = entry1.value(); // Extract value
let (vec1, _) = entry1.value();
if let Some(entry2) = map2.get(key) {
let (vec2, _) = entry2.value(); // Correctly extract value
let (vec2, _) = entry2.value();
if vec1 != vec2 {
return false;
}
@@ -22,6 +23,7 @@ pub fn dashmaps(map1: &RwLockWriteGuard<DashMap<String, (Vec<(String, u16)>, Ato
}
true
}
*/
#[allow(dead_code)]
pub fn dm(map1: &RwLockReadGuard<DashMap<String, (Vec<(String, u16)>, AtomicUsize)>>, map2: &DashMap<String, (Vec<(String, u16)>, AtomicUsize)>) -> bool {