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

Issue 1289703003: FX_CMapDwordToDword considered harmful. (Closed)

Created:
5 years, 4 months ago by Tom Sepez
Modified:
5 years, 4 months ago
Reviewers:
Lei Zhang
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

FX_CMapDwordToDword considered harmful. Lookups are log(n), but random insertions could result in n^2 behaviour. Replace with maps and sets. R=thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/85d5c4af4a9546970b34dd413c473d10fef8534b

Patch Set 1 #

Total comments: 2

Patch Set 2 : Rebase, remove if(). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -147 lines) Patch
M core/include/fxcrt/fx_basic.h View 1 1 chunk +0 lines, -15 lines 0 comments Download
M core/src/fpdfapi/fpdf_font/font_int.h View 1 1 chunk +1 line, -1 line 0 comments Download
M core/src/fpdfapi/fpdf_font/fpdf_font.cpp View 7 chunks +12 lines, -16 lines 0 comments Download
M core/src/fpdfapi/fpdf_font/ttgsubtable.h View 1 chunk +1 line, -1 line 0 comments Download
M core/src/fpdfapi/fpdf_font/ttgsubtable.cpp View 1 1 chunk +6 lines, -13 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp View 7 chunks +10 lines, -33 lines 0 comments Download
M core/src/fxcrt/fx_basic_maps.cpp View 1 1 chunk +0 lines, -68 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
Tom Sepez
Lei, for review.
5 years, 4 months ago (2015-08-17 23:00:33 UTC) #2
Lei Zhang
lgtm Be sure to do: git gs FX_CMapDwordToDword and make sure there's not any more ...
5 years, 4 months ago (2015-08-17 23:45:13 UTC) #3
Tom Sepez
On 2015/08/17 23:45:13, Lei Zhang wrote: > lgtm > > Be sure to do: git ...
5 years, 4 months ago (2015-08-18 16:18:16 UTC) #4
Tom Sepez
Committed patchset #2 (id:20001) manually as 85d5c4af4a9546970b34dd413c473d10fef8534b (presubmit successful).
5 years, 4 months ago (2015-08-18 16:20:33 UTC) #5
Tom Sepez
5 years, 4 months ago (2015-08-18 16:21:42 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/1289703003/diff/1/core/src/fpdfapi/fpdf_font/...
File core/src/fpdfapi/fpdf_font/ttgsubtable.cpp (right):

https://codereview.chromium.org/1289703003/diff/1/core/src/fpdfapi/fpdf_font/...
core/src/fpdfapi/fpdf_font/ttgsubtable.cpp:99: if (m_featureMap.find(i) ==
m_featureMap.end()) {
On 2015/08/17 23:45:13, Lei Zhang wrote:
> Assuming we started with an empty map on line 95 and the for-loop as is, this
> will eval to true every time.
Indeed it will.

Powered by Google App Engine
This is Rietveld 408576698