Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
36ca59f1
Unverified
Commit
36ca59f1
authored
Jun 18, 2023
by
Dan Laine
Committed by
GitHub
Jun 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: use slices package for sorting (#27486)
parent
d40a255e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
update-license.go
build/update-license.go
+5
-9
No files found.
build/update-license.go
View file @
36ca59f1
...
...
@@ -46,12 +46,13 @@ import (
"path/filepath"
"regexp"
"runtime"
"sort"
"strconv"
"strings"
"sync"
"text/template"
"time"
"golang.org/x/exp/slices"
)
var
(
...
...
@@ -152,13 +153,6 @@ func (i info) gpl() bool {
return
false
}
// authors implements the sort.Interface for strings in case-insensitive mode.
type
authors
[]
string
func
(
as
authors
)
Len
()
int
{
return
len
(
as
)
}
func
(
as
authors
)
Less
(
i
,
j
int
)
bool
{
return
strings
.
ToLower
(
as
[
i
])
<
strings
.
ToLower
(
as
[
j
])
}
func
(
as
authors
)
Swap
(
i
,
j
int
)
{
as
[
i
],
as
[
j
]
=
as
[
j
],
as
[
i
]
}
func
main
()
{
var
(
files
=
getFiles
()
...
...
@@ -299,7 +293,9 @@ func writeAuthors(files []string) {
}
}
// Write sorted list of authors back to the file.
sort
.
Sort
(
authors
(
list
))
slices
.
SortFunc
(
list
,
func
(
a
,
b
string
)
bool
{
return
strings
.
ToLower
(
a
)
<
strings
.
ToLower
(
b
)
})
content
:=
new
(
bytes
.
Buffer
)
content
.
WriteString
(
authorsFileHeader
)
for
_
,
a
:=
range
list
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment