- remove clang 9 warnings
- simplify if / else branches
Details
- Reviewers
hindenburg ngraham - Group Reviewers
Konsole - Commits
- R319:208218dec98a: Small code simplifications
Diff Detail
- Repository
- R319 Konsole
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
{}; means “default value of the return type”, so I’m retirning a QUrl()
where it’s supposed to be a QUrl, and a QString where it’s supposed to be a
string.
This is more future proof as if we change the type of the function we don’t
need to change that return.
Em qua, 10 de abr de 2019 às 19:21, Nathaniel Graham <
noreply@phabricator.kde.org> escreveu:
ngraham added inline comments. View Revision
https://phabricator.kde.org/D20438
*INLINE COMMENTS*
View Inline https://phabricator.kde.org/D20438#inline-114927
BookmarkHandler.cpp:105
}
return {};
}Why not an empty QUrl()?
View Inline https://phabricator.kde.org/D20438#inline-114928
BookmarkHandler.cpp:145
}
return {};
}Why not an empty QString()?
*REPOSITORY*
R319 Konsole*REVISION DETAIL*
https://phabricator.kde.org/D20438*To: *tcanabrava, Konsole, hindenburg
*Cc: *ngraham, konsole-devel, gennad, thsurrel, maximilianocuria,
hindenburg
src/BookmarkHandler.cpp | ||
---|---|---|
105 | The author is trying to use return {} feature in C++ 11. However, QUrl() is more explicit for those who does or doesn't know about the previously mentioned feature. Explicit is better then Implicit. |