aboutsummaryrefslogtreecommitdiffstats
path: root/c_lhosts.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-15 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-15 20:20:20 +0100
commita71d9a4f7d91934e385cdbb37d55e7a6b6c6e5bd (patch)
tree09721ce4af940749365bc30619e0d57093d1a3b6 /c_lhosts.go
parentfuck sel_max (diff)
downloadhardflip-a71d9a4f7d91934e385cdbb37d55e7a6b6c6e5bd.tar.gz
hardflip-a71d9a4f7d91934e385cdbb37d55e7a6b6c6e5bd.tar.bz2
hardflip-a71d9a4f7d91934e385cdbb37d55e7a6b6c6e5bd.tar.xz
hardflip-a71d9a4f7d91934e385cdbb37d55e7a6b6c6e5bd.tar.zst
hardflip-a71d9a4f7d91934e385cdbb37d55e7a6b6c6e5bd.zip
fuck ids
Diffstat (limited to 'c_lhosts.go')
-rw-r--r--c_lhosts.go24
1 files changed, 0 insertions, 24 deletions
diff --git a/c_lhosts.go b/c_lhosts.go
index 2e99264..654da13 100644
--- a/c_lhosts.go
+++ b/c_lhosts.go
@@ -54,7 +54,6 @@ package main
// 0: ssh
// 1: rdp
type HostNode struct {
- ID int
Protocol int8 `yaml:"type"`
Name string `yaml:"name"`
Host string `yaml:"host"`
@@ -91,7 +90,6 @@ func (lhost *HostList) add_back(node *HostNode) {
return
}
last := lhost.last
- node.ID = last.ID + 1
last.next = node
lhost.last = last.next
}
@@ -107,9 +105,6 @@ func (lhost *HostList) del(host *HostNode) {
lhost.last = nil
return
}
- for ptr := lhost.head; ptr != nil; ptr = ptr.next {
- ptr.ID -= 1
- }
return
}
if lhost.last == host {
@@ -128,25 +123,6 @@ func (lhost *HostList) del(host *HostNode) {
if ptr.next == host {
ptr.next = ptr.next.next
}
- for ptr := ptr.next; ptr != nil; ptr = ptr.next {
- ptr.ID -= 1
- }
-}
-
-// returns the list node with the according id
-func (lhost *HostList) sel(id int) *HostNode {
- curr := lhost.head
-
- if curr == nil {
- return nil
- }
- for curr.next != nil && curr.ID != id {
- curr = curr.next
- }
- if curr.ID != id {
- return nil
- }
- return curr
}
func (lhost *HostList) count() int {