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

Fix inconsistent code styles in OkHttpStreamFetcher. #397

Merged
merged 1 commit into from
Apr 10, 2015
Merged

Fix inconsistent code styles in OkHttpStreamFetcher. #397

merged 1 commit into from
Apr 10, 2015

Conversation

floating-cat
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 84.06% when pulling 4eba230 on floating-cat:master into c78ee4e on bumptech:master.

@sjudd
Copy link
Collaborator

sjudd commented Apr 10, 2015

Thanks!

sjudd added a commit that referenced this pull request Apr 10, 2015
Fix inconsistent code styles in OkHttpStreamFetcher.
@sjudd sjudd merged commit 8d7beb5 into bumptech:master Apr 10, 2015
@TWiStErRob
Copy link
Collaborator

Thanks for the PR!

Some (late) feedback: In general I prefer putting the if outside the try, because entering/exiting try may be slower.

Even though I didn't find any hard evidence on this in the last 10 minutes of research, this statement is convinced me to continue preferring it:

Placing code inside a try-catch block inhibits certain optimizations that modern JVM implementations might otherwise perform.

It also helps devs to skip the try block if they're reading code and they know a certain variable's nullity.

@sjudd
Copy link
Collaborator

sjudd commented Apr 10, 2015

Makes sense, when we pull this stuff into a utility method (more pull requests always welcome :)), we can if outside of try.

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

Successfully merging this pull request may close these issues.

4 participants