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

net/http: minor optimization to copyValues #33744

Closed
rsc opened this issue Aug 20, 2019 · 2 comments
Closed

net/http: minor optimization to copyValues #33744

rsc opened this issue Aug 20, 2019 · 2 comments

Comments

@rsc
Copy link
Contributor

@rsc rsc commented Aug 20, 2019

net/http has:

func copyValues(dst, src url.Values) {
	for k, vs := range src {
		for _, value := range vs {
			dst.Add(k, value)
		}
	}
}

This should probably be:

func copyValues(dst, src url.Values) {
	for k, vs := range src {
		dst[k] = append(dst[k], vs...)
	}
}

Noted on #33498

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 21, 2019

Change https://golang.org/cl/191057 mentions this issue: net/http: minor optimization to copyValues

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 22, 2019

Change https://golang.org/cl/191278 mentions this issue: Master

@gopherbot gopherbot closed this in 141b097 Sep 7, 2019
@golang golang locked and limited conversation to collaborators Sep 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.