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:
Arnaud VERSINI 2024-12-27 14:03:08 +01:00 committed by Arnaud Versini
parent bf7ac07c04
commit e47aebcec5

View File

@ -48,7 +48,7 @@ void GenericTypeSerializer::readColor(Color& rColor)
}
else
{
static const std::vector<Color> staticColorArray = {
static constexpr Color staticColorArray[] = {
COL_BLACK, // COL_BLACK
COL_BLUE, // COL_BLUE
COL_GREEN, // COL_GREEN
@ -82,7 +82,7 @@ void GenericTypeSerializer::readColor(Color& rColor)
COL_BLACK // COL_FIELDTEXT
};
if (nColorNameID < staticColorArray.size())
if (nColorNameID < std::size(staticColorArray))
rColor = staticColorArray[nColorNameID];
else
rColor = COL_BLACK;