Details
- Reviewers
kfunk - Group Reviewers
KDevelop - Commits
- R33:690a874543f8: Use static_cast when sure about the result
R32:690a874543f8: Use static_cast when sure about the result
Diff Detail
- Repository
- R33 KDevPlatform
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Micro-optimization at best, but looks okay.
Also: I usually transform Foo* foo = static_cast<Foo*>(...) into auto foo = static_cast<Foo*>(...) -- easier to read; there's already the type information on the RHS.
plugins/documentview/kdevdocumentview.cpp | ||
---|---|---|
257 ↗ | (On Diff #15910) | Looks like we should rather Q_ASSERT(fileItem) here? |
plugins/grepview/grepoutputmodel.cpp | ||
263 ↗ | (On Diff #15910) | Note (unrelated): Should rename current_item to currentItem |
plugins/documentview/kdevdocumentview.cpp | ||
---|---|---|
257 ↗ | (On Diff #15910) | Rather no, fileItem is allowed to be nullptr. If something could be tested, dynamic_cast<KDevDocumentItem*> would be it, though there is no real danger some none-KDevDocumentItem is coming from the model, |
plugins/documentview/kdevdocumentview.cpp | ||
---|---|---|
257 ↗ | (On Diff #15910) | Ah, sorry, I missed the ->fileItem(). Makes sense then. |