You've already forked mpbot-github
mirror of
https://github.com/macports/mpbot-github.git
synced 2026-03-31 14:46:03 -07:00
Improve code readability
This commit is contained in:
@@ -32,9 +32,10 @@ func GetChangedPortList() ([]string, error) {
|
||||
} else if match = renameGrep.FindStringSubmatch(line); match == nil {
|
||||
continue
|
||||
}
|
||||
if _, ok := portsFound[match[1]]; !ok {
|
||||
portsFound[match[1]] = true
|
||||
ports = append(ports, match[1])
|
||||
port := match[1]
|
||||
if _, ok := portsFound[port]; !ok {
|
||||
portsFound[port] = true
|
||||
ports = append(ports, port)
|
||||
}
|
||||
}
|
||||
if err = gitCmd.Wait(); err != nil {
|
||||
|
||||
@@ -43,10 +43,11 @@ func (client *githubClient) ListChangedPortsAndFiles(owner, repo string, number
|
||||
}
|
||||
match := portGrep.FindStringSubmatch(fileName)
|
||||
if match != nil {
|
||||
if idx, ok := portsFound[match[1]]; !ok {
|
||||
ports = append(ports, match[1])
|
||||
port := match[1]
|
||||
if idx, ok := portsFound[port]; !ok {
|
||||
ports = append(ports, port)
|
||||
commitFiles = append(commitFiles, file)
|
||||
portsFound[match[1]] = len(ports) - 1
|
||||
portsFound[port] = len(ports) - 1
|
||||
} else {
|
||||
if match[2] == "Portfile" {
|
||||
commitFiles[idx] = file
|
||||
|
||||
Reference in New Issue
Block a user