[RFC PATCH 2/3] alsa: Allow "fallback" configuration for mappings and profiles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux