A bunch of conditions in the specifier printing loop are meaningless,
since all valid specifier types take idenical execution paths through
this function. So much of this can just be deleted.
{
size_t ret = 0, rc = 0;
- for (struct cdecl_declspec *c = s; c; c = c->next) {
- switch (cdecl_spec_kind(c) & mask) {
- case CDECL_SPEC_FUNC:
- case CDECL_SPEC_STOR:
- case CDECL_SPEC_QUAL:
- case CDECL_SPEC_TYPE:
- ret += cdecl__advance(&buf, &n, rc);
- rc = explain_spec(buf, n, c);
- }
+ for (; s; s = s->next) {
+ if (!(s->type & mask))
+ continue;
+
+ ret += cdecl__advance(&buf, &n, rc);
+ rc = explain_spec(buf, n, s);
}
return ret + rc;