From 1552d967decdbc560d86b8021e9911b5c5604591 Mon Sep 17 00:00:00 2001 From: cybergenik Date: Mon, 5 Aug 2024 21:55:37 -0400 Subject: [PATCH] readability with standard ok ret val in GetFTask on Node --- node/node.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/node/node.go b/node/node.go index 568319a..f43cc1f 100644 --- a/node/node.go +++ b/node/node.go @@ -29,15 +29,15 @@ type HopperNode struct { conn *rpc.Client } -func (n *HopperNode) getFTask() (c.FTask, bool) { +func (n *HopperNode) getFTask() (bool, c.FTask) { args := c.FTaskArgs{} t := c.FTask{} if ok := n.call("Hopper.GetFTask", &args, &t); !ok { log.Println("Error Getting FTask!") - return t, ok + return ok, t } - return t, true + return true, t } // Returns Bool : True if Master wants to Log crash @@ -141,7 +141,7 @@ func (n *HopperNode) fuzz(t c.FTask) { func (n *HopperNode) taskGenerator(taskQ chan c.FTask) { for !n.killed() { - ftask, ok := n.getFTask() + ok, ftask := n.getFTask() if !ok || ftask.Die { atomic.StoreInt32(&n.dead, 1) return -- 2.45.2