From: Markus Scherer Date: Thu, 24 Sep 2020 21:53:08 +0000 (-0700) Subject: ICU-21269 ParagraphLayout complexTable: init & access based on actual values X-Git-Tag: release-68-alpha~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65ec5621b4550bd76b9dc6e8747fff84b43da868;p=icu ICU-21269 ParagraphLayout complexTable: init & access based on actual values --- diff --git a/icu4c/source/layoutex/ParagraphLayout.cpp b/icu4c/source/layoutex/ParagraphLayout.cpp index 9e525cf1c52..0a765a34c9e 100644 --- a/icu4c/source/layoutex/ParagraphLayout.cpp +++ b/icu4c/source/layoutex/ParagraphLayout.cpp @@ -137,7 +137,7 @@ le_int32 StyleRuns::getRuns(le_int32 runLimits[], le_int32 styleIndices[]) * process, rather for all scripts which require * complex processing for correct rendering. */ -static const le_bool complexTable[scriptCodeCount] = { +static const le_bool complexTable[] = { FALSE , /* Zyyy */ FALSE, /* Qaai */ TRUE, /* Arab */ @@ -974,7 +974,7 @@ le_int32 ParagraphLayout::getLanguageCode(const Locale *locale) le_bool ParagraphLayout::isComplex(UScriptCode script) { - if (script < 0 || script >= (UScriptCode) scriptCodeCount) { + if (script < 0 || script >= ARRAY_SIZE(complexTable)) { return FALSE; }