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

Issue 1430643007: Remove state from RebuildCrossRef state-machine. (Closed)

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

Description

Remove state from RebuildCrossRef state-machine. The state '12' is only used once. This CL folds the contents of state 12 back into the place where we set our state to 12. This works because all state 12 does is decrement the loop counter so we process the same character again and move us to state 0. R=thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/395fbedc65e1261f1fb9189205501f4856235290

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -8 lines) Patch
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp View 1 chunk +1 line, -8 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
dsinclair
PTAL.
5 years, 1 month ago (2015-11-04 17:37:19 UTC) #2
Lei Zhang
lgtm
5 years, 1 month ago (2015-11-04 18:13:47 UTC) #3
dsinclair
Committed patchset #1 (id:1) manually as 395fbedc65e1261f1fb9189205501f4856235290 (presubmit successful).
5 years, 1 month ago (2015-11-04 18:58:17 UTC) #4
Tom Sepez
LGTM. As an aside, I've been really reluctant to mess with this given the fragility ...
5 years, 1 month ago (2015-11-04 19:00:03 UTC) #5
dsinclair
5 years, 1 month ago (2015-11-04 19:02:31 UTC) #6
Message was sent while issue was closed.
On 2015/11/04 19:00:03, Tom Sepez wrote:
> LGTM.  
> 
> As an aside, I've been really reluctant to mess with this given the fragility
of
> the way it's coded. If you're looking for a follow-up, one of the things I'd
> consider is moving all of the "actions" performed apart from parsing into
their
> own functions so that this loop is just about traversing characters and
> manipulating state.


That's the plan. My current goal is just to name the states as my little brain
can't handle seeing case: 1 {state = 3}; case 4: {state = 12;} and actualling
understanding what's happening.

Powered by Google App Engine
This is Rietveld 408576698