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

Remove switch in sxw_resource.c #204

Closed
chaukap opened this issue Dec 31, 2018 · 1 comment
Closed

Remove switch in sxw_resource.c #204

chaukap opened this issue Dec 31, 2018 · 1 comment
Assignees
Labels
enhancement in progress Task is currently in progress
Milestone

Comments

@chaukap
Copy link
Contributor

chaukap commented Dec 31, 2018

On line 270 there is a switch statement that used to assign different transpiration fractions to different rgroups.

        switch (t) {
            case 0://Tree
                transp = SXW.transpTotal;
                break;
            case 1://Shrub
                transp = SXW.transpTotal;
                break;
            case 2://Grass
                transp = SXW.transpTotal;
                break;
            case 3://Forb
                transp = SXW.transpTotal;
                break;
            default:
                transp = SXW.transpTotal;
                break;
            }

Since we are using space now all of the switch cases do the exact same thing. Therefore, the entire switch can be replaced with

transp = SXW.transpTotal;
@kpalmqui
Copy link
Member

kpalmqui commented Jan 1, 2019

@chaukap good idea, thanks!

chaukap pushed a commit that referenced this issue Jan 21, 2019
Because all cases of the switch statement did the exact same thing, the entire block has been replaced with `transp = SXW.transpTotal`
@chaukap chaukap closed this as completed Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement in progress Task is currently in progress
Projects
None yet
Development

No branches or pull requests

2 participants