Skip to content

Why use multiple fields for non-variable Span components? #29

Answered by BurntSushi
Diggsey asked this question in Q&A
Discussion options

You must be logged in to vote

There is some mention of it here: #17

And as a result of Span being large, this issue is also relevant: #21

And then finally, the use of ranged integers internally is also a constraint here: #11

The distinct fields of Span in terms of representation isn't tied to the public API. So that is something that can change in a semver compatible release. The main reason I just did the simple approach for a field for each unit is that:

  • It's, well, the simple approach. Even if some of the non-variable Span fields were packed into a tighter representation, it would save some space, but Span would still be very bulky. So I perceived the difference between "simple" and "packed" as not enormous. But m…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Diggsey
Comment options

@BurntSushi
Comment options

Answer selected by BurntSushi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants