mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-10 02:25:56 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user