RESOLVED INVALID 27378
cpplint has some issues with one lines if-sentences
https://bugs.webkit.org/show_bug.cgi?id=27378
Summary cpplint has some issues with one lines if-sentences
Kenneth Rohde Christiansen
Reported 2009-07-17 10:14:44 PDT
The following is legal according to the coding style document, but cpplint complains about it. At least I was told that on the IRC once. if (something) { method1(); method2(); } else { method3(); } Example: WebKit/qt/Api/qwebpage.cpp:2409: One line control clauses should not use braces. [whitespace/braces] [4] 2404 if (subString.isEmpty()) { 2405 d->page->unmarkAllTextMatches(); 2406 return true; 2407 } else { 2408 return d->page->markAllMatchesForText(subString, caseSensitivity, true, 0); 2409 }
Attachments
Mark Rowe (bdash)
Comment 1 2009-07-17 17:47:37 PDT
The coding style states that there should be no braces around the body of the else, so the complaint is correct.
Kenneth Rohde Christiansen
Comment 2 2009-07-17 17:53:05 PDT
Yes, I got this one wrong, and will update our Qt sources accordingly. Thanks bdash. Am I supposed to close this bug, or just leave it as resolved?
Adam Treat
Comment 3 2009-07-17 17:57:20 PDT
Resolved means it is closed :)
Kenneth Rohde Christiansen
Comment 4 2009-07-17 18:03:40 PDT
Ah OK. :-) Just got confused as there is a separate CLOSE item in the status dropdown menu.
Note You need to log in before you can comment on or make changes to this bug.