Fix some issues found with clang-tidy (#4353)

* directoryiterator: Fix missing inline

Add missing inline to inline function.

This was found with clang-tidy check:  misc-definitions-in-headers

* Convert deprecated throw() to noexcept

throw() has been deprecated in standar in C++17. It has been removed in
C++20. Code still compiles but let's just define these at those should
be.

These where found with clang-tidy check: modernize-use-noexcept

* Fix unnecessary copy initializations

Clang-tidy did find these with check:

  performance-unnecessary-copy-initialization

* Fix some strings not references

Looks like these are just missing reference marks.

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
Kari Argillander
2023-12-17 17:55:30 +02:00
committed by GitHub
parent 111fe90dd9
commit bf3c519183
15 changed files with 29 additions and 30 deletions

View File

@@ -148,8 +148,8 @@ void Connection::connect(const std::string& uri, SocketFactory& socketFactory)
Poco::URI theURI(uri);
if (theURI.getScheme() != "mongodb") throw Poco::UnknownURISchemeException(uri);
std::string userInfo = theURI.getUserInfo();
std::string host = theURI.getHost();
const std::string& userInfo = theURI.getUserInfo();
const std::string& host = theURI.getHost();
Poco::UInt16 port = theURI.getPort();
if (port == 0) port = 27017;