ax(node): rename d to deduplicator in NewMessageDeduplicator (AX-1)
Single-letter variable `d` requires a reader to infer its type from context. Rename to `deduplicator` — predictable names over short names (RFC-CORE-008 §1). Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
b59fcc18a8
commit
22a74415f3
1 changed files with 2 additions and 2 deletions
|
|
@ -64,11 +64,11 @@ type MessageDeduplicator struct {
|
|||
// dedup.Mark(msg.ID)
|
||||
// if dedup.IsDuplicate(msg.ID) { continue }
|
||||
func NewMessageDeduplicator(ttl time.Duration) *MessageDeduplicator {
|
||||
d := &MessageDeduplicator{
|
||||
deduplicator := &MessageDeduplicator{
|
||||
seen: make(map[string]time.Time),
|
||||
ttl: ttl,
|
||||
}
|
||||
return d
|
||||
return deduplicator
|
||||
}
|
||||
|
||||
// if dedup.IsDuplicate(msg.ID) { continue } // drop already-processed message
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue