diff mbox series

[committed] d: Use startswith function instead of strncmp

Message ID 20210518210114.551984-1-ibuclaw@gdcproject.org
State New
Headers show
Series [committed] d: Use startswith function instead of strncmp | expand

Commit Message

Iain Buclaw May 18, 2021, 9:01 p.m. UTC
Hi,

This patch updates TypeVisitor in types.cc to use startswith instead of
strncmp.

Bootstrapped and regression tested on x86_64-linux-gnu, and committed to
mainline.

Regards,
Iain.

---
gcc/d/ChangeLog:

	* types.cc (TypeVisitor::visit (TypeEnum *)): Use startswith function
	instead of strncmp.
---
 gcc/d/types.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/d/types.cc b/gcc/d/types.cc
index 3b121f5b042..ba2d6d4dc66 100644
--- a/gcc/d/types.cc
+++ b/gcc/d/types.cc
@@ -874,7 +874,7 @@  public:
 	Type *underlying = NULL;
 
 	/* Skip over the prefixing `__c_'.  */
-	gcc_assert (strncmp (ident, "__c_", strlen ("__c_")) == 0);
+	gcc_assert (startswith (ident, "__c_"));
 	ident = ident + strlen ("__c_");
 
 	/* To keep things compatible within the code generation we stick to