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

Minor Simplifications #9

Open
simlu opened this issue Sep 30, 2017 · 0 comments
Open

Minor Simplifications #9

simlu opened this issue Sep 30, 2017 · 0 comments

Comments

@simlu
Copy link
Contributor

simlu commented Sep 30, 2017

Block b = freeBlock;
if (b != null)
freeBlock = null;
else
b = new Block();
block = b;

How about

        block = freeBlock == null ? new Block() : freeBlock;
        freeBlock = null;

Shorter and more understandable.

Also the first throw exception is unnecessary.

Created a PR here: #10

@simlu simlu changed the title Minor Simplification Minor Simplifications Sep 30, 2017
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

No branches or pull requests

1 participant