-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Refactor issue label selection #31497
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
Conversation
d8e8edc
to
b992000
Compare
labelQuerySliceStrings[i] = strconv.FormatInt(x, 10) | ||
} | ||
labelQuerySliceStrings := labelQueryParams.Values() | ||
slices.Sort(labelQuerySliceStrings) // the sort is still needed because the underlying map of Set doesn't guarantee order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little warning: probably acceptable in this case but you're sorting strings now so it will output something like 1,10,2
instead of 1,2,10
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't really see the necessity.
They are IDs and are totally transparent to other modules, the only thing we need to do is to make them ordered, so string comparing or number comparing doesn't matter.
Think about another case, if we have a lot of UUIDs as IDs, we could also just sort them, and we do not really care about why A<B
or A>B
* giteaofficial/main: Refactor issue label selection (go-gitea#31497) Refactor dropzone (go-gitea#31482) [skip ci] Updated translations via Crowdin Optimization of labels handling in issue_search (go-gitea#26460) use correct l10n string (go-gitea#31487) Fix overflow menu flickering on mobile (go-gitea#31484)
I was unable to create a backport for 1.22. @wxiaoguang, please send one manually. 🍵
|
Follow #26460, rename the variable names to follow Golang standard, and use
container.Set[string]
directly to simplify the code.