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

Unified Diff: xfa/fgas/layout/fgas_rtfbreak.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
« no previous file with comments | « no previous file | xfa/fgas/layout/fgas_textbreak.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fgas/layout/fgas_rtfbreak.cpp
diff --git a/xfa/fgas/layout/fgas_rtfbreak.cpp b/xfa/fgas/layout/fgas_rtfbreak.cpp
index 388a3be6f9247e48aad5d07db4da8fd8a27ae610..e1cb6d2784bafce95f27441c37c3e2fba80e8f8b 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.cpp
+++ b/xfa/fgas/layout/fgas_rtfbreak.cpp
@@ -990,16 +990,14 @@ int32_t CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray& tca,
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 (nCur == FX_CBP_TB) {
Lei Zhang 2016/06/10 21:40:47 This block looks identical to the one above. Merge
Tom Sepez 2016/06/10 21:56:57 Not quite. One sets bNeedBreak to !bSpaceBreak an
bNeedBreak = !bTabBreak;
if (nNext == FX_CBP_TB) {
eType = bTabBreak ? 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;
@@ -1009,8 +1007,7 @@ int32_t CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray& tca,
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) {
« no previous file with comments | « no previous file | xfa/fgas/layout/fgas_textbreak.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698