Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

chore: slice loop replace #399

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions differs/pip_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ func (a PipAnalyzer) getPackages(image pkgutil.Image) (map[string]map[string]uti
}
if config.Config.Env != nil {
paths := getPythonPaths(config.Config.Env)
for _, p := range paths {
pythonPaths = append(pythonPaths, p)
}
pythonPaths = append(pythonPaths, paths...)
}
pythonVersions, err := getPythonVersion(path)
if err != nil {
Expand Down
12 changes: 3 additions & 9 deletions util/diff_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ func GetAdditions(a, b []string) []string {
for _, opCode := range group {
j1, j2 := opCode.J1, opCode.J2
if opCode.Tag == 'r' || opCode.Tag == 'i' {
for _, line := range b[j1:j2] {
adds = append(adds, line)
}
adds = append(adds, b[j1:j2]...)
}
}
}
Expand All @@ -78,9 +76,7 @@ func GetDeletions(a, b []string) []string {
for _, opCode := range group {
i1, i2 := opCode.I1, opCode.I2
if opCode.Tag == 'r' || opCode.Tag == 'd' {
for _, line := range a[i1:i2] {
dels = append(dels, line)
}
dels = append(dels, a[i1:i2]...)
}
}
}
Expand All @@ -96,9 +92,7 @@ func GetMatches(a, b []string) []string {
if i != len(matchindexes)-1 {
start := match.A
end := match.A + match.Size
for _, line := range a[start:end] {
matches = append(matches, line)
}
matches = append(matches, a[start:end]...)
}
}
return matches
Expand Down