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

refactor assignment syntax in simdrive_impl #94

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

kylecarow
Copy link
Collaborator

Noticed the syntax on assignments to simdrive arrays could be cleaner, so I tidied those up.

Before:

if condition_1 {
    LHS = value_1;
} else if condition_2 {
    LHS = value_2;
} else {
    LHS = value_3;
}

After:

LHS = if condition_1 {
    value_1
} else if condition_2 {
    value_2
} else {
    value_3
};

Also prevented recalculating dt_s() many times in set_post_scalars

@kylecarow kylecarow requested a review from calbaker January 22, 2024 20:14
@calbaker
Copy link
Collaborator

Also prevented recalculating dt_s() many times in set_post_scalars

Does this mean it's faster?

@calbaker calbaker merged commit 662bd71 into fastsim-2 Jan 22, 2024
3 checks passed
@kylecarow kylecarow deleted the f2/small-syntax-refactor branch January 24, 2024 19:41
@kylecarow
Copy link
Collaborator Author

Does this mean it's faster?

@calbaker I would assume so, but I didn't benchmark it. It's also in a function that's only run once per sim_drive() call

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