Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: xfa/fgas/layout/fgas_textbreak.cpp

Issue 2063463002: Trust the compiler to do array indexing and superclass promotion. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/fgas/layout/fgas_textbreak.cpp
diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp
index 56850c741c827723b004836b0b4d789ad4227b52..c8d33baa80fa4649ed3918d1a4870827ae7bffea 100644
--- a/xfa/fgas/layout/fgas_textbreak.cpp
+++ b/xfa/fgas/layout/fgas_textbreak.cpp
@@ -1014,8 +1014,7 @@ int32_t CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray& ca,
if (nNext == FX_CBP_SP) {
eType = bSpaceBreak ? FX_LBT_DIRECT_BRK : FX_LBT_PROHIBITED_BRK;
} else {
- eType = *((const FX_LINEBREAKTYPE*)gs_FX_LineBreak_PairTable +
- (nCur << 5) + nNext);
+ eType = gs_FX_LineBreak_PairTable[nCur][nNext];
}
} else if (bNumberBreak && nCur == FX_CBP_NU && nNext == FX_CBP_NU) {
eType = FX_LBT_DIRECT_BRK;
@@ -1023,8 +1022,7 @@ int32_t CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray& ca,
if (nNext == FX_CBP_SP) {
eType = FX_LBT_PROHIBITED_BRK;
} else {
- eType = *((const FX_LINEBREAKTYPE*)gs_FX_LineBreak_PairTable +
- (nCur << 5) + nNext);
+ eType = gs_FX_LineBreak_PairTable[nCur][nNext];
}
}
if (bAllChars) {

Powered by Google App Engine
This is Rietveld 408576698