tools : use constexpr array instead of std::vector
Change-Id: Ifade95457b4b7c614a4ec83857c822d349a9f88d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179444 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Arnaud Versini <arnaud.versini@pm.me>
This commit is contained in:
committed by
Arnaud Versini
parent
bf7ac07c04
commit
e47aebcec5
@@ -48,7 +48,7 @@ void GenericTypeSerializer::readColor(Color& rColor)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
static const std::vector<Color> staticColorArray = {
|
static constexpr Color staticColorArray[] = {
|
||||||
COL_BLACK, // COL_BLACK
|
COL_BLACK, // COL_BLACK
|
||||||
COL_BLUE, // COL_BLUE
|
COL_BLUE, // COL_BLUE
|
||||||
COL_GREEN, // COL_GREEN
|
COL_GREEN, // COL_GREEN
|
||||||
@@ -82,7 +82,7 @@ void GenericTypeSerializer::readColor(Color& rColor)
|
|||||||
COL_BLACK // COL_FIELDTEXT
|
COL_BLACK // COL_FIELDTEXT
|
||||||
};
|
};
|
||||||
|
|
||||||
if (nColorNameID < staticColorArray.size())
|
if (nColorNameID < std::size(staticColorArray))
|
||||||
rColor = staticColorArray[nColorNameID];
|
rColor = staticColorArray[nColorNameID];
|
||||||
else
|
else
|
||||||
rColor = COL_BLACK;
|
rColor = COL_BLACK;
|
||||||
|
Reference in New Issue
Block a user