NEW151329
Removed needless hasAnItem assignment in TypeSet
https://bugs.webkit.org/show_bug.cgi?id=151329
Summary Removed needless hasAnItem assignment in TypeSet
Matthew Daiter
Reported 2015-11-16 16:09:22 PST
There was an assignment to hasAnItem that didn't need to be set in the last if block of checking m_seenTypes, because hasAnItem is immediately set to false after the block.
Attachments
Patch (1.25 KB, patch)
2015-11-16 16:11 PST, Matthew Daiter
achristensen: review-
achristensen: commit-queue-
Matthew Daiter
Comment 1 2015-11-16 16:11:49 PST
Alex Christensen
Comment 2 2015-11-17 11:03:14 PST
Comment on attachment 265635 [details] Patch While this change is technically ok, it only saves one bool assignment that might even be optimized out. It makes the code less consistent and might cause a problem in the future. What motivated this change?
Saam Barati
Comment 3 2015-11-17 11:18:01 PST
(In reply to comment #2) > Comment on attachment 265635 [details] > Patch > > While this change is technically ok, it only saves one bool assignment that > might even be optimized out. It makes the code less consistent and might > cause a problem in the future. What motivated this change? I think keeping the assignment in makes adding new types in the future less error prone because it provides an easy copy-paste template.
Alex Christensen
Comment 4 2015-11-17 11:18:36 PST
Comment on attachment 265635 [details] Patch Me, too.
Saam Barati
Comment 5 2015-11-17 11:22:51 PST
Also note that the efficiency of this code doesn't matter. It's only used in tests (and I suppose it can also be used in debugging).
Note You need to log in before you can comment on or make changes to this bug.