summaryrefslogtreecommitdiff
path: root/src/fsm.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-04-20 16:22:07 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-04-20 16:22:07 +0200
commitb73e1489b06fd4546da6ba32697331584db02e71 (patch)
tree3893b79958b551d2552efb6d20e729d916346ec6 /src/fsm.go
parent63dfe633c7e62f570d44af6e0ea17967155cb5db (diff)
Refactor: Eliminate most uses of pointers in structs
Diffstat (limited to 'src/fsm.go')
-rw-r--r--src/fsm.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/fsm.go b/src/fsm.go
index 2e778d9..c51d345 100644
--- a/src/fsm.go
+++ b/src/fsm.go
@@ -93,10 +93,6 @@ type FSM struct {
}
func (eduvpn *VPNState) HasTransition(check FSMStateID) bool {
- // No fsm
- if eduvpn.FSM == nil {
- return false
- }
for _, transition_state := range eduvpn.FSM.States[eduvpn.FSM.Current] {
if transition_state.To == check {
return true
@@ -107,10 +103,6 @@ func (eduvpn *VPNState) HasTransition(check FSMStateID) bool {
}
func (eduvpn *VPNState) InState(check FSMStateID) bool {
- // No fsm
- if eduvpn.FSM == nil {
- return false
- }
return check == eduvpn.FSM.Current
}
@@ -184,7 +176,7 @@ func (eduvpn *VPNState) GenerateGraph() string {
}
func (eduvpn *VPNState) InitializeFSM() {
- eduvpn.FSM = &FSM{
+ eduvpn.FSM = FSM{
States: FSMStates{
DEREGISTERED: {{NO_SERVER, "Client registers"}},
NO_SERVER: {{CHOSEN_SERVER, "User chooses a server"}},