Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Simplify ttconv loop #938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 9, 2012
Merged

Conversation

jkseppan
Copy link
Member

@jkseppan jkseppan commented Jun 9, 2012

Replace a while loop with complicated break and continue cases by a for loop that has the iteration and end-condition testing in one place only.

This was last touched by @mdboom and @cgohlke in #933; does this look right and does the #933 crash stay fixed?

jkseppan added 3 commits June 9, 2012 13:48
Apparently some compilers don't support that.
Replace a while loop with complicated break and continue cases by
a for loop that has the iteration and end-condition testing in one
place only.
Having the prev and next iterators is not much worse than indexing
the vector, and initializing the vector became too verbose.
@jdh2358
Copy link
Collaborator

jdh2358 commented Jun 9, 2012

Compiles and tests pass on ubuntu 12.04 with freetype 2.4.8 (with the unrelated exception of the one test in #939)

@jkseppan
Copy link
Member Author

jkseppan commented Jun 9, 2012

I just pushed a merge of another branch touching this, which reportedly fixes #937. (The previous comment by jdh2358 predates the push, although github shows the commits above it.)

Compiles and passes at least test_ttconv and test_text on MacOSX 10.6.8, Python 2.7.2.

@jdh2358
Copy link
Collaborator

jdh2358 commented Jun 9, 2012

Are we holding on @cgohlke to test this before the rc2? AFAIK, this is the last release_critical issue (#937).

@jkseppan
Copy link
Member Author

jkseppan commented Jun 9, 2012

IMHO we could merge this now. The problem in #937 was that for some reason the Microsoft compiler didn't recognize the STL idiom I used to convert a list into a vector, and this version doesn't create the vector at all. The crash in #933 was because the code accessed memory past the end of the (empty) vector, even though it didn't use the result for anything - presumably the compiler I was using had optimized away the read, but another compiler had not. This version has a check against that case, so I don't think that crash can occur.

@jdh2358
Copy link
Collaborator

jdh2358 commented Jun 9, 2012

OK, I'm merging and cutting rc2. If there are additional problems we can fix them before the final release.

jdh2358 added a commit that referenced this pull request Jun 9, 2012
@jdh2358 jdh2358 merged commit 97f7130 into matplotlib:v1.1.x Jun 9, 2012
@jkseppan jkseppan deleted the simplify-ttconv-loop branch July 6, 2015 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants