Skip to content

Commit

Permalink
Cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Teiva Harsanyi committed Feb 27, 2023
1 parent e7b4c83 commit 2f11000
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions challenge-3d-broadcast/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ type server struct {

func (s *server) initHandler(_ maelstrom.Message) error {
s.nodeID = s.n.ID()
v, err := id(s.nodeID)
id, err := strconv.Atoi(s.nodeID[1:])
if err != nil {
return err
}
s.id = v
s.id = id
return nil
}

Expand Down Expand Up @@ -165,11 +165,3 @@ func (s *server) topologyHandler(msg maelstrom.Message) error {
"type": "topology_ok",
})
}

func id(s string) (int, error) {
i, err := strconv.Atoi(s[1:])
if err != nil {
return 0, err
}
return i, nil
}

0 comments on commit 2f11000

Please sign in to comment.