[pulseaudio-discuss] [RFC PATCH 2/3] alsa: Allow "fallback" configuration for mappings and profiles
Alexander E. Patrakov
patrakov at gmail.com
Fri Jul 25 21:52:01 PDT 2014
25.07.2014 19:31, David Henningsson wrote:
> +again:
> PA_HASHMAP_FOREACH(p, ps->profiles, state) {
...
> }
>
> + if (!tryfallback && (profilesfound == 0)) {
> + tryfallback = true;
> + goto again;
> + }
> +
Ugh. Surely this can be expressed without a goto that goes up? E.g. by
making a new function and calling it once or twice, depending on whether
it found any profiles on the first call.
I understand that there is at least one more place in PulseAudio with
that "change a boolean flag and goto up" idiom, so the criticism may be
invalid when applied to PulseAudio.
--
Alexander E. Patrakov
More information about the pulseaudio-discuss
mailing list