From 634a24fe19edbb2d356a5b48d3f0b7189fa10c09 Mon Sep 17 00:00:00 2001 From: Aroy-Art Date: Thu, 18 Jul 2024 23:25:52 +0200 Subject: [PATCH] Remove: left over code --- multi-threading/fibonacci-multi-threaded.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/multi-threading/fibonacci-multi-threaded.go b/multi-threading/fibonacci-multi-threaded.go index c3b86b4..badca94 100644 --- a/multi-threading/fibonacci-multi-threaded.go +++ b/multi-threading/fibonacci-multi-threaded.go @@ -56,13 +56,11 @@ func main() { } // Send tasks to the task channel - for i := 1; i <= numTasks; i++ { - n := rand.Intn(maxFib - minFib) - tasks <- Task{id: i, n: 30} // n=30 is computationally intensive for Fibonacci - } - + for i := 1; i <= numTasks; i++ { n := rand.Intn(maxFib - minFib) // Random number between minFib and maxFib tasks <- Task{id: i, n: n} + } + // Close the task channel to signal no more tasks close(tasks)