Skip to content

Commit

Permalink
perf(lib): optimize thread_manager_end thread()
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasanchez committed Apr 22, 2022
1 parent 40f622f commit 822459f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/util/thread_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int thread_manager_end_thread(thread_manager_t *tm)
return EXIT_FAILURE;

// Move the last positition to the deleted one.
if (tm->size > 0)
if (tm->size > 1)
tm->threads[t_id] = tm->threads[tm->size - 1];

tm->size--;
Expand Down

0 comments on commit 822459f

Please sign in to comment.