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

fix comment claiming ParseConnectionID reuses the data slice #3848

Merged
merged 1 commit into from
May 21, 2023

Conversation

sukunrt
Copy link
Collaborator

@sukunrt sukunrt commented May 20, 2023

This is protocol.ParseConnectionID. It copies data from b.

func ParseConnectionID(b []byte) ConnectionID {
	if len(b) > maxConnectionIDLen {
		panic("invalid conn id length")
	}
	var c ConnectionID
	c.l = uint8(len(b))
	copy(c.b[:c.l], b)
	return c
}

Feel free to close if this is too small etc. Apologies if this is just plain mistaken.

@codecov
Copy link

codecov bot commented May 20, 2023

Codecov Report

Merging #3848 (2b4d964) into master (da198b7) will increase coverage by 0.01%.
The diff coverage is 70.21%.

@@            Coverage Diff             @@
##           master    #3848      +/-   ##
==========================================
+ Coverage   83.92%   83.94%   +0.01%     
==========================================
  Files         142      146       +4     
  Lines       14208    14307      +99     
==========================================
+ Hits        11924    12009      +85     
- Misses       1850     1858       +8     
- Partials      434      440       +6     
Impacted Files Coverage Δ
internal/wire/header.go 82.23% <ø> (ø)
quicvarint/varint.go 76.47% <ø> (+9.23%) ⬆️
sys_conn_helper_nonlinux.go 50.00% <50.00%> (ø)
sys_conn_buffers_write.go 57.78% <57.78%> (ø)
sys_conn_buffers.go 64.44% <64.44%> (ø)
transport.go 62.45% <72.73%> (-2.08%) ⬇️
sys_conn_helper_linux.go 81.25% <81.25%> (ø)
sys_conn_oob.go 73.68% <100.00%> (+4.57%) ⬆️
sys_conn_windows.go 100.00% <100.00%> (+27.27%) ⬆️

... and 1 file with indirect coverage changes

@marten-seemann marten-seemann changed the title Fix comment. ParseConnectionID doesn't reuse data slice fix comment claiming ParseConnectionID reuses the data slice May 21, 2023
Copy link
Member

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! That's correct. Must have missed to update the comment in #3529.

@marten-seemann marten-seemann merged commit cb3453d into quic-go:master May 21, 2023
17 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants