Skip to content

Commit

Permalink
Testing move constructor sonar find (#5557)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarchant authored and jordanmurray35 committed Feb 1, 2023
1 parent 6b9987a commit 82fb846
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions hoot-core/src/main/cpp/hoot/core/util/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ Settings::Settings()
_staticRegex.optimize();
}

Settings::Settings(Settings && s) noexcept
: _settings{s._settings},
_settingsStack{s._settingsStack}
{
s._settings.clear();
while (!s._settingsStack.empty())
s._settingsStack.pop();
_dynamicRegex.swap(s._dynamicRegex);
_staticRegex.swap(s._staticRegex);
}

void Settings::prepend(const QString& key, const QStringList& values)
{
QStringList l = getList(key, QStringList());
Expand Down
6 changes: 5 additions & 1 deletion hoot-core/src/main/cpp/hoot/core/util/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* This will properly maintain the copyright information. Maxar
* copyrights will be updated automatically.
*
* @copyright Copyright (C) 2015, 2017, 2018, 2019, 2020, 2021, 2022 Maxar (http://www.maxar.com/)
* @copyright Copyright (C) 2015, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Maxar (http://www.maxar.com/)
*/

#ifndef CONFIGURATION_H
Expand Down Expand Up @@ -59,6 +59,10 @@ class Settings
// sense for it to remain public. Possibly, we need a separate class for HootSettings that would
// then be a true Singleton?
Settings();
Settings(const Settings& s) = default;
Settings(Settings && s) noexcept;

Settings& operator=(const Settings& s) = default;

using SettingsMap = QHash<QString, QVariant>;

Expand Down

0 comments on commit 82fb846

Please sign in to comment.