make sure the bottom of QKeySequence::operator[] is really unreachable

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-08-27 17:08:40 +03:00
parent c05116aeca
commit 6eb9bec4aa

View file

@ -1028,8 +1028,9 @@ QKeySequence::operator QVariant() const
*/
QKeySequence::operator int () const
{
if (1 <= count())
if (1 <= count()) {
return key1;
}
return 0;
}
@ -1048,6 +1049,9 @@ int QKeySequence::operator[](uint index) const
case 1: {
return key2;
}
default: {
return 0;
}
}
Q_UNREACHABLE();
}