Skip to content
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

CMap: Source property fix and remove branching #121

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

chr5tphr
Copy link
Owner

  • for ColorMap, the source property did not set ._source, which caused
    the getter of ColorMap.source to always return None; this commit sets
    ._source in the setter
  • in ColorMap._parse, the value was computed conditionioned with if ...
    elifon the token type, which could either bei shortcolor or longcolor,
    but implied the possibility that neither could be true; this commit
    removes the branching and introduces value_it, which is either
    token.value itself or an iterator, such that the value assignment is
    independent of the color length

- for ColorMap, the source property did not set ._source, which caused
  the getter of ColorMap.source to always return None; this commit sets
  ._source in the setter
- in ColorMap._parse, the value was computed conditionioned with if ...
  elifon the token type, which could either bei shortcolor or longcolor,
  but implied the possibility that neither could be true; this commit
  removes the branching and introduces value_it, which is either
  token.value itself or an iterator, such that the value assignment is
  independent of the color length
@chr5tphr chr5tphr merged commit b8438ff into master Apr 21, 2022
@chr5tphr chr5tphr deleted the cmap-source-and-parse-color branch April 21, 2022 14:36
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.

None yet

1 participant