Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Chore: Make some Maps into real Sets#4362

Merged
RPRX merged 2 commits intoXTLS:mainfromarturmelanchyk:fix-map
Feb 7, 2025
Merged

Conversation

arturmelanchyk
Copy link
Contributor

No description provided.

@RPRX
Copy link
Member

RPRX commentedFeb 7, 2025

麻烦基于07c35ed rebase 一下

Signed-off-by: Artur Melanchyk <arturmelanchyk@imail.name>
Signed-off-by: Artur Melanchyk <arturmelanchyk@imail.name>
@arturmelanchyk
Copy link
ContributorAuthor

Hi@RPRX
the branch has been rebased

@RPRX
Copy link
Member

RPRX commentedFeb 7, 2025

这是在解决什么问题?Golang 的新行为?

@RPRX
Copy link
Member

RPRX commentedFeb 7, 2025

虽然 struct{} 在 Golang 中地位确实特殊

有相关解释发来看一下吗

@RPRX
Copy link
Member

RPRX commentedFeb 7, 2025

你的意思是反正存储 true 或 false 都用不到,不如用空值struct{}

@arturmelanchyk
Copy link
ContributorAuthor

@RPRX
in this specific casemap[string]bool is used as aSet, to keep unique values as keys of the map. Thebool is redundant and not needed. By havingstruct{} instead of irrelevantbool valueswe avoid unneeded memory allocation as well as we avoid confusion for developers

@RPRX
Copy link
Member

RPRX commentedFeb 7, 2025

这下真把 map 用成集合了

@RPRXRPRX changed the titlefix: make portsInUse map a setChore: Make some Maps into SetsFeb 7, 2025
@RPRXRPRX changed the titleChore: Make some Maps into SetsChore: Make some Maps into real SetsFeb 7, 2025
@RPRXRPRX merged commitae327eb intoXTLS:mainFeb 7, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@arturmelanchyk@RPRX

[8]ページ先頭

©2009-2025 Movatter.jp