Skip to content

Commit c2b63bd

Browse files
committed
core/connmap: do not track dups
1 parent 35f60a5 commit c2b63bd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

intra/core/connmap.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,14 @@ func (h *cm) addByPidLocked(pid, cid string) {
110110
if len(pid) <= 0 || len(cid) <= 0 {
111111
return
112112
}
113-
// TODO: remove duplicates
114-
h.tracp[pid] = append(h.tracp[pid], cid)
113+
h.tracp[pid] = CopyUniq(h.tracp[pid], []string{cid})
115114
}
116115

117116
func (h *cm) addByUidLocked(uid, cid string) {
118117
if len(uid) <= 0 || len(cid) <= 0 {
119118
return
120119
}
121-
// TODO: remove duplicates
122-
h.tracu[uid] = append(h.tracu[uid], cid)
120+
h.tracu[uid] = CopyUniq(h.tracu[uid], []string{cid})
123121
}
124122

125123
func (h *cm) getLocked(cid string) *connstat {

0 commit comments

Comments
 (0)