You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jason Song 477a1cc40e
Improve utils of slices (#22379)
- Move the file `compare.go` and `slice.go` to `slice.go`.
- Fix `ExistsInSlice`, it's buggy
  - It uses `sort.Search`, so it assumes that the input slice is sorted.
- It passes `func(i int) bool { return slice[i] == target })` to
`sort.Search`, that's incorrect, check the doc of `sort.Search`.
- Conbine `IsInt64InSlice(int64, []int64)` and `ExistsInSlice(string,
[]string)` to `SliceContains[T]([]T, T)`.
- Conbine `IsSliceInt64Eq([]int64, []int64)` and `IsEqualSlice([]string,
[]string)` to `SliceSortedEqual[T]([]T, T)`.
- Add `SliceEqual[T]([]T, T)` as a distinction from
`SliceSortedEqual[T]([]T, T)`.
- Redesign `RemoveIDFromList([]int64, int64) ([]int64, bool)` to
`SliceRemoveAll[T]([]T, T) []T`.
- Add `SliceContainsFunc[T]([]T, func(T) bool)` and
`SliceRemoveAllFunc[T]([]T, func(T) bool)` for general use.
- Add comments to explain why not `golang.org/x/exp/slices`.
- Add unit tests.
1 year ago
..
activity.go Implement FSFE REUSE for golang files (#21840) 2 years ago
attachment.go Add API management for issue/pull and comment attachments (#21783) 2 years ago
blame.go Implement FSFE REUSE for golang files (#21840) 2 years ago
branch.go Use context parameter in models/git (#22367) 1 year ago
cherry_pick.go Rename almost all Ctx functions (#22071) 2 years ago
commit.go Use context parameter in models/git (#22367) 1 year ago
compare.go Use context parameter in models/git (#22367) 1 year ago
download.go Use context parameter in models/git (#22367) 1 year ago
editor.go Rename almost all Ctx functions (#22071) 2 years ago
editor_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
find.go Implement FSFE REUSE for golang files (#21840) 2 years ago
http.go Rename almost all Ctx functions (#22071) 2 years ago
http_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue.go Improve utils of slices (#22379) 1 year ago
issue_content_history.go Multiple improvements for comment edit diff (#21990) 2 years ago
issue_dependency.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_label.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_label_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_lock.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_stopwatch.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_timetrack.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_watch.go Implement FSFE REUSE for golang files (#21840) 2 years ago
lfs.go Use context parameter in models/git (#22367) 1 year ago
main_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
middlewares.go Implement FSFE REUSE for golang files (#21840) 2 years ago
migrate.go Implement FSFE REUSE for golang files (#21840) 2 years ago
milestone.go Rename almost all Ctx functions (#22071) 2 years ago
packages.go Use dynamic package type list (#22263) 2 years ago
patch.go Rename almost all Ctx functions (#22071) 2 years ago
projects.go Rename almost all Ctx functions (#22071) 2 years ago
projects_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
pull.go Use context parameter in models/git (#22367) 1 year ago
pull_review.go Implement FSFE REUSE for golang files (#21840) 2 years ago
release.go Add Feed for Releases and Tags (#21696) 2 years ago
release_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
render.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Move `convert` package to services (#22264) 2 years ago
search.go Implement FSFE REUSE for golang files (#21840) 2 years ago
setting.go Secrets storage with SecretKey encrypted (#22142) 2 years ago
setting_protected_branch.go Use context parameter in models/git (#22367) 1 year ago
settings_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tag.go Use context parameter in models/git (#22367) 1 year ago
topic.go Implement FSFE REUSE for golang files (#21840) 2 years ago
treelist.go Implement FSFE REUSE for golang files (#21840) 2 years ago
view.go Use context parameter in models/git (#22367) 1 year ago
view_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
webhook.go Improve utils of slices (#22379) 1 year ago
wiki.go Use context parameter in models/git (#22367) 1 year ago
wiki_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago