Skip to content

cmd/compile: avoid updating capacity if unused #23831

@dsnet

Description

@dsnet

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
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions