Fixed unintentional fallthrough in switch statement.

This commit is contained in:
Mat Sutcliffe
2019-01-03 23:24:19 +00:00
parent afd9541eb3
commit 0c5442d59c

View File

@@ -269,6 +269,7 @@ namespace BlackMisc
case Contains: return getString().contains(other.getSubstring());
default: ;
}
break;
case AnyOf:
switch (other.m_strategy)
{
@@ -277,8 +278,8 @@ namespace BlackMisc
case EndsWith: return std::all_of(m_strings.begin(), m_strings.end(), [ & ](const QString & s) { return s.endsWith(other.getSuffix()); });
case Contains: return std::all_of(m_strings.begin(), m_strings.end(), [ & ](const QString & s) { return s.contains(other.getSubstring()); });
default: ;
BLACK_FALLTHROUGH ;
}
break;
case AllOf:
switch (other.m_strategy)
{
@@ -289,8 +290,8 @@ namespace BlackMisc
case EndsWith: return std::any_of(m_strings.begin(), m_strings.end(), [ & ](const QString & s) { return s.endsWith(other.getSuffix()); });
case Contains: return std::any_of(m_strings.begin(), m_strings.end(), [ & ](const QString & s) { return s.contains(other.getSubstring()); });
default: ;
BLACK_FALLTHROUGH ;
}
break;
case StartsWith:
switch (other.m_strategy)
{
@@ -298,6 +299,7 @@ namespace BlackMisc
case Contains: return getPrefix().contains(other.getSubstring());
default: ;
}
break;
case EndsWith:
switch (other.m_strategy)
{
@@ -305,12 +307,14 @@ namespace BlackMisc
case Contains: return getSuffix().contains(other.getSubstring());
default: ;
}
break;
case Contains:
switch (other.m_strategy)
{
case Contains: return getSubstring().contains(other.getSubstring()) && getSubstring().size() > other.getSubstring().size();
default: ;
}
break;
default:;
}
return false;