refactor: Remove unreachable dead code branches
- Host.ToFrontend: Remove redundant h.DisplayName check after struct initialization already set host.DisplayName = h.DisplayName Function now at 100% coverage.
This commit is contained in:
parent
c1d98e6aa8
commit
a647ffb219
1 changed files with 3 additions and 6 deletions
|
|
@ -318,12 +318,9 @@ func (h Host) ToFrontend() HostFrontend {
|
|||
LastSeen: h.LastSeen.Unix() * 1000,
|
||||
}
|
||||
|
||||
if host.DisplayName == "" {
|
||||
if h.DisplayName != "" {
|
||||
host.DisplayName = h.DisplayName
|
||||
} else if h.Hostname != "" {
|
||||
host.DisplayName = h.Hostname
|
||||
}
|
||||
// Fall back to Hostname if DisplayName is empty
|
||||
if host.DisplayName == "" && h.Hostname != "" {
|
||||
host.DisplayName = h.Hostname
|
||||
}
|
||||
|
||||
if len(h.LoadAverage) > 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue