Skip to content

fmt: (*pp).doPrintf inernal code implementation #71910

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

Closed
Guest-615695028 opened this issue Feb 23, 2025 · 3 comments
Closed

fmt: (*pp).doPrintf inernal code implementation #71910

Guest-615695028 opened this issue Feb 23, 2025 · 3 comments
Labels
Implementation Issues describing a semantics-preserving change to the Go implementation. Proposal

Comments

@Guest-615695028
Copy link

Proposal Details

It is suggested that “%%” be moved here to increase output speed, because the verb "%" is generally used without a flag.

simpleFormat:
	for ; i < end; i++ {
		c := format[i]
		switch c {
		case '#':
			p.fmt.sharp = true
		case '0':
			p.fmt.zero = true
		case '+':
			p.fmt.plus = true
		case '-':
			p.fmt.minus = true
		case ' ':
			p.fmt.space = true
		case '%':
			p.buf.writeByte('%')
			continue formatLoop
		default: ...
		}
	...
	}
@gabyhelp
Copy link

Related Code Changes

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@Guest-615695028
Copy link
Author

Sorry, I cannot find anything helpful in such URL.

@gabyhelp gabyhelp added the Implementation Issues describing a semantics-preserving change to the Go implementation. label Feb 23, 2025
@seankhliao
Copy link
Member

this does not look like a proposal to me

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation Issues describing a semantics-preserving change to the Go implementation. Proposal
Projects
None yet
Development

No branches or pull requests

3 participants