How? it needs to scan the whole symbol to check if it's valid, while the loop below prints progressively; so merging them would either require writing to an intermediate buffer (bleh :( ) or just printing demangled up until the first invalid point and printing literally from there (bleh :( ). In any case this is a cold/debugging code path, so micro-optimisation doesn't matter.