Re: [dev] Parentheses

2013-07-04 Thread Truls Becken
On 2013-07-04, at 14:12, Bjartur Thorlacius wrote: >> type = argv[1][0] == 'b' ? S_IFBLK : S_IFCHR; > type = ((argv[1][0] == 'b') ? S_IFBLK : S_IFCHR) Yes, David did the commit with parens around the test. Not around the elvis operator, though. -Truls

[dev] Parentheses

2013-07-04 Thread Bjartur Thorlacius
Galos, David: The types array stood out to me as a bit of a code smell. After pondering over it for a couple of minutes, I realized that you could just do this: type = argv[1][0] == 'b' ? S_IFBLK : S_IFCHR; type = ((argv[1][0] == 'b') ? S_IFBLK : S_IFCHR)