Skip to content

Commit

Permalink
client: imp code
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Apr 1, 2024
1 parent 548a15c commit 025c29b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ func (r *Runtime) SetWHOIS(info *whois.Info) {
r.whois = info
}

// Unset clears a cs information.
func (r *Runtime) Unset(cs Source) {
// unset clears a cs information.
func (r *Runtime) unset(cs Source) {
switch cs {
case SourceWHOIS:
r.whois = nil
Expand All @@ -162,8 +162,8 @@ func (r *Runtime) Unset(cs Source) {
}
}

// IsEmpty returns true if there is no information from any source.
func (r *Runtime) IsEmpty() (ok bool) {
// isEmpty returns true if there is no information from any source.
func (r *Runtime) isEmpty() (ok bool) {
return r.whois == nil &&
r.arp == nil &&
r.rdns == nil &&
Expand Down
4 changes: 2 additions & 2 deletions internal/client/runtimeindex.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ func (ri *RuntimeIndex) Delete(ip netip.Addr) {
// the specified source and returns the number of removed clients.
func (ri *RuntimeIndex) DeleteBySource(src Source) (n int) {
for ip, rc := range ri.index {
rc.Unset(src)
rc.unset(src)

if rc.IsEmpty() {
if rc.isEmpty() {
delete(ri.index, ip)
n++
}
Expand Down

0 comments on commit 025c29b

Please sign in to comment.