From 96dc1f236c96369e93b3cbd8078a81275611f7bc Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 30 Sep 2022 19:17:26 -0700 Subject: [PATCH] gc cntCluster: use 'startswith' to abbreviate a 'strncmp' --- cmd/tools/gc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/tools/gc.c b/cmd/tools/gc.c index c3899aa1b..93ad8a566 100644 --- a/cmd/tools/gc.c +++ b/cmd/tools/gc.c @@ -26,6 +26,7 @@ #include #include #include +#include typedef struct { Agrec_t h; @@ -187,7 +188,7 @@ static void cntCluster(Agraph_t * g, Agobj_t * sg, void *arg) char *sgname = agnameof(sg); - if (strncmp(sgname, "cluster", 7) == 0) + if (startswith(sgname, "cluster")) *(int *) (arg) += 1; } -- 2.40.0