-
Notifications
You must be signed in to change notification settings - Fork 154
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
Store startOffset + length instead of startOffset + endOffset #872
Comments
Actually it seems much easier to only change it for serialization for now, as that has much less potential for conflicts, etc. So it's more about consistency and what's more useful to track inside C structs. |
Now that #873 is merged, I think we should change it for Java Nodes and Ruby Locations, because that avoids extra work like #873 (comment) and also some places need to recompute the length from end_offset - start_offset which feels inefficient. I'm not sure about C nodes structs though, WDYT @jemmaissroff ? |
I think we should prioritize keeping it consistent. I'm worried we'll make the changes for Java Nodes and Ruby Locations, and then add the C Nodes to the backlog without committing to doing it. |
Actually there is an advantage to store it as (start, length) for C structs too because typedef struct {
const char *start;
const char *end;
} yp_location_t; |
@jemmaissroff Should we change it for C structs too? How do we do that without having huge conflicts? |
I gave it a shot at main...eregon:yarp:c-struct-length, that compiles but many offsets are wrong, there must be some mistranslation. |
This works in the serialization, but I think it would not be worth it in the actual library. I'm going to close this now that we have it in the serialization. |
From #741 (comment)
Doing so is simply better for the serialized size, because length is always <= endOffset, and often much smaller.
I think it might make sense to change it everywhere, but we could also just change it for serialization.
@jemmaissroff WDYT?
The text was updated successfully, but these errors were encountered: