* common/config/arm/arm-common.c (compare_opt_names): Add function
comment. Use strcmp instead of manual loop.
From-SVN: r255942
+2017-12-21 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * common/config/arm/arm-common.c (compare_opt_names): Add function
+ comment. Use strcmp instead of manual loop.
+
2017-12-21 Martin Liska <mliska@suse.cz>
PR gcov-profile/83509
return arm_rewrite_selected_cpu (argv[argc - 1]);
}
+/* Comparator for arm_rewrite_selected_arch. Compare the two arch extension
+ strings FIRST and SECOND and return TRUE if FIRST is less than SECOND
+ alphabetically. */
+
static bool
compare_opt_names (const char *first, const char *second)
{
- for (int i = 0; ; i++)
- if (first[i] == 0
- || first[i] < second[i])
- return true;
- return false;
+ return strcmp (first, second) <= 0;
}
/* Rewrite the architecture string for passing to the assembler.