Skip to content
Snippets Groups Projects
Commit 03880a32 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

prefer empty

parent d95325ae
No related branches found
No related tags found
1 merge request!454Further changes suggested by clang-tidy
......@@ -67,6 +67,7 @@ Checks: '*,
-cppcoreguidelines-avoid-non-const-global-variables,
-llvm-include-order,
-readability-redundant-access-specifiers,
-*special-member-functions,
-SectionComment_Resolving_the_following_checks_would_be_too_much_work_right_now,
......@@ -81,11 +82,13 @@ Checks: '*,
-bugprone-parent-virtual-call,
-clang-analyzer-core.CallAndMessage,
-clang-analyzer-optin.cplusplus.VirtualCall,
-hicpp-member-init,
-modernize-loop-convert,
-modernize-pass-by-value,
-modernize-use-using,
-special-member-functions,
-misc-non-private-member-variables-in-classes,
-SectionComment_Temporarily_disabled_checks__We_need_to_investigate_them_one_by_one,
'
......@@ -126,7 +126,7 @@ std::string printValue(double value, const std::string& units)
return printDegrees(value);
if (units == "nm")
return printNm(value);
if (units == "")
if (units.empty())
return printDouble(value);
ASSERT(0);
}
......
......@@ -48,7 +48,7 @@ void GroupInfo::add(const QString& itemType)
QString GroupInfo::defaultType() const
{
if (m_defaultItemType == "" && m_info.size() != 0)
if (m_defaultItemType.empty() && !m_info.empty())
return m_info[0].m_itemType;
return m_defaultItemType;
}
......
......@@ -134,7 +134,7 @@ ComboProperty GUI::Model::JobItemUtils::availableUnits(const ICoordSystem& conve
ComboProperty result;
for (auto units : converter.availableUnits()) {
auto unit_name = nameFromCoords(units);
if (unit_name != "")
if (!unit_name.empty())
result << unit_name;
}
......
......@@ -22,7 +22,7 @@ namespace {
std::unique_ptr<OutputData<double>> load(const std::string& name)
{
ASSERT(name != "");
ASSERT(!name.empty());
const std::string path =
BaseUtils::Filesystem::jointPath(BATesting::ReferenceDir_Std(), name + ".int.gz");
std::unique_ptr<OutputData<double>> data;
......
......@@ -32,7 +32,7 @@ bool checkSimulation(const std::string& name, const ISimulation& direct_simulati
std::unique_ptr<OutputData<double>> reference;
// Load reference if available.
ASSERT(name != "");
ASSERT(!name.empty());
try {
const std::string refPath =
BaseUtils::Filesystem::jointPath(BATesting::ReferenceDir_Std(), name + ".int.gz");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment