stat: optimize counter removal

This commit is contained in:
eric committed 2022-04-13 23:37:51 +08:00
1 parent 039d95955c
commit eeb44485ad
1 file changed
+1 -1
+1 -1
View File
@@ -178,7 +178,7 @@ impl StatManager {
let mut i = 0;
while i < sm.counters.len() {
if sm.counters[i].recv_completed() && sm.counters[i].send_completed() {
sm.counters.remove(i);
sm.counters.swap_remove(i);
} else {
i += 1;
}