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

[Codechange] Clearing out and reordering of the beam_t members #556

Merged
merged 3 commits into from Jan 14, 2016

Conversation

Projects
None yet
3 participants
@ulteq
Contributor

ulteq commented Jan 11, 2016

Before: sizeof(beam_t) = 208
After: sizeof(beam_t) = 164

All frequently accessed data is within the first 64 Bytes of the struct.

@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur Jan 11, 2016

what if shtruck was 0 here?

Hiradur commented on source/main/physics/Beam.cpp in 2bd80dd Jan 11, 2016

what if shtruck was 0 here?

@ulteq

This comment has been minimized.

Show comment
Hide comment
@ulteq

ulteq Jan 11, 2016

Contributor

This can't happen, because shorter != 0 implies shtruck != 0.
https://github.com/ulteq/rigs-of-rods/blob/beam_t_Reordering/source/main/physics/Beam.cpp#L4363

But you are right, I will change it into it->beam->p2truck = (shtruck != 0);. It's much cleaner that way.

Edit: Here as well: it->beam->p2truck = (it->lockTruck != 0);

Contributor

ulteq commented Jan 11, 2016

This can't happen, because shorter != 0 implies shtruck != 0.
https://github.com/ulteq/rigs-of-rods/blob/beam_t_Reordering/source/main/physics/Beam.cpp#L4363

But you are right, I will change it into it->beam->p2truck = (shtruck != 0);. It's much cleaner that way.

Edit: Here as well: it->beam->p2truck = (it->lockTruck != 0);

@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur Jan 11, 2016

basically the same thing here

basically the same thing here

@only-a-ptr

This comment has been minimized.

Show comment
Hide comment
@only-a-ptr

only-a-ptr Jan 12, 2016

WTF is shtruck? more descriptive, pls.
EDIT: Nevermind, I didn't notice it's just a local.

only-a-ptr commented on c875af8 Jan 12, 2016

WTF is shtruck? more descriptive, pls.
EDIT: Nevermind, I didn't notice it's just a local.

only-a-ptr added a commit that referenced this pull request Jan 14, 2016

Merge pull request #556 from ulteq/beam_t_Reordering
[Codechange] Clearing out and reordering of the beam_t members

@only-a-ptr only-a-ptr merged commit f8cdbb6 into RigsOfRods:master Jan 14, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ulteq ulteq deleted the ulteq:beam_t_Reordering branch Jan 14, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment