[Ffmpeg-devel] [PATCH] Wildcard and catalog image sequences

Måns Rullgård mru
Fri Sep 1 00:36:08 CEST 2006


Michael Niedermayer said:
> Hi
>
> On Wed, Aug 30, 2006 at 02:28:57PM +0200, Michel Bardiaux wrote:
>> Michael Niedermayer wrote:
>> >looking at for example:
>> >
>> >>>+int filename_catalog_test(const char *filename)
>> >>>+{
>> >>>+    if(!filename)
>> >>>+        return (-1);
>> >>>+    else if(filename[0]=='@')
>> >>>+        return 0;
>> >>>+    else
>> >>>+        return (-1);
>> >
>> >versus
>> >
>> >>return filename && filename[0]=='@';
>> >
>> >i cant see how the later is more obfuscated, additionally
>>
>> I dont mean all one-liners are obfuscated, only that they quickly become
>> so. Esp. since the correct one is
>>
>> return (filename && filename[0]=='@')?0:-1; // justified below.
>>
>> Still reasonable, but the one about wildcards is even bigger. If one has
>> to code for multiple levels of conditions, nested ?: become quite
>> unreadable. So there is a limit to one-liners, and where it is is a
>> matter of taste, isnt it?
>
> sure but my suggestion wouldnt need the ?: and without that the one liner
> really seems to be the better solution

return -(filename && filename[0] == '@');

-- 
M?ns Rullg?rd
mru at inprovide.com




More information about the ffmpeg-devel mailing list