From 548230e45e0bc9fa985d80714ede4c39a347d508 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 15 Jul 2023 13:13:16 -0600 Subject: [PATCH] [graph] Early return from a function --- src/graph/graph.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/graph/graph.hh b/src/graph/graph.hh index 9e962cfc5..5a6fc1b82 100644 --- a/src/graph/graph.hh +++ b/src/graph/graph.hh @@ -213,7 +213,10 @@ struct graph_t for (unsigned i = 0; i < count; i++) { if (parents.arrayZ[i] == old_index) - parents.arrayZ[i] = new_index; + { + parents.arrayZ[i] = new_index; + break; + } } }