[llvm] r259937 - [llvm-nm] Transform a switch() statement in a pair of if(s).
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 5 14:15:13 PST 2016
On Fri, Feb 5, 2016 at 2:12 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>
> On Fri, Feb 5, 2016 at 2:07 PM, Davide Italiano via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>>
>> Author: davide
>> Date: Fri Feb 5 16:07:09 2016
>> New Revision: 259937
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=259937&view=rev
>> Log:
>> [llvm-nm] Transform a switch() statement in a pair of if(s).
>>
>> This is more uniform wrt what other tools do and makes the code
>> a little bit more readable.
>>
>> Modified:
>> llvm/trunk/tools/llvm-nm/llvm-nm.cpp
>>
>> Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=259937&r1=259936&r2=259937&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
>> +++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Fri Feb 5 16:07:09 2016
>> @@ -1267,15 +1267,10 @@ int main(int argc, char **argv) {
>> PrintAddress = false;
>> if (OutputFormat == sysv || SizeSort)
>> PrintSize = true;
>> -
>> - switch (InputFilenames.size()) {
>> - case 0:
>> + if (InputFilenames.size() == 0)
>
>
> Prefer 'empty' rather than size == 0
>
r259938. Thanks!
--
Davide
More information about the llvm-commits
mailing list