Opened 10 years ago Closed 10 years ago #1377 closed enhancement (wontfix)strange code
Description
In TAppDecTop.cpp line 126 there is
Is double "!!" really better than while (bitstreamFile) ? Change History (3)comment:1 Changed 10 years ago by DefaultCC Plugin
comment:2 Changed 10 years ago by dthoangcomment:3 Changed 10 years ago by ksuehring
I made a quick test with clang and it generates exactly the same assembler code for implicit conversion as for the double negation.
I guess, it's fine as it it, but I don't have strong feelings...
Closing as won't fix. Feel free to reopen, if you think we should change it. Note: See
TracTickets for help on using
tickets. | This list contains all users that will be notified about changes made to this ticket. These roles will be notified: Reporter, Owner, Subscriber, Participant
|
The ! operator is used twice in this context to convert the type of bitstreamFile to bool. It is shorter than (bitstreamFile != 0), which has type bool. The type of bistreamFile by itself is not bool. It depends on how strict you are as a programmer and how strict the compiler is. I consider it good coding practice.