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

shorter return when meet if #7

Open
baishuai opened this issue Dec 27, 2016 · 0 comments
Open

shorter return when meet if #7

baishuai opened this issue Dec 27, 2016 · 0 comments

Comments

@baishuai
Copy link

baishuai commented Dec 27, 2016

https://github.com/g0hacker/goc2p/blob/master/src/basic/map1/omap.go#L38

return omap.elemType == reflect.TypeOf(e)

this is better than

if reflect.TypeOf(e) != omap.elemType {
	return false
}
return true
@baishuai baishuai changed the title shorter shorter return when meet if Dec 27, 2016
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