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

cmd/compile: avoid updating capacity if unused #23831

Closed
dsnet opened this issue Feb 14, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@dsnet
Copy link
Member

commented Feb 14, 2018

Consider the following code:

func ASCII(b []byte) bool {
	for len(b) >= 8 {
		x := binary.LittleEndian.Uint64(b)
		if x&0x8080808080808080 > 0 {
			return false
		}
		b = b[8:]
	}
	for _, x := range b {
		if x&0x80 > 0 {
			return false
		}
	}
	return true
}

@dsnet dsnet closed this Feb 14, 2018

@bradfitz

This comment has been minimized.

Copy link
Member

commented Feb 14, 2018

Easy fix.

@golang golang locked and limited conversation to collaborators Feb 14, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.