Skip to content

Commit

Permalink
fix pkg version check (guacsec#563)
Browse files Browse the repository at this point in the history
Signed-off-by: pxp928 <[email protected]>
  • Loading branch information
pxp928 authored Mar 10, 2023
1 parent 3f27938 commit fb63f8e
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions pkg/assembler/backends/testing/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,13 @@ func registerVersion(n *model.PackageName, version, subpath string, qualifiers .
}
// TODO(mihaimaruseac): This is O(n*m) instead of O(n+m)
allFound := true
for i, _ := range v.Qualifiers {
if i%2 != 0 {
continue
}
dbKey := v.Qualifiers[i]
dbValue := v.Qualifiers[i+1]
for _, qualifier := range v.Qualifiers {
dbKey := qualifier.Key
dbValue := qualifier.Value
found := false
for j, _ := range inputQualifiers {
if j%2 != 0 {
continue
}
if inputQualifiers[j] == dbKey &&
inputQualifiers[j+1] == dbValue {
for _, inputQualifier := range inputQualifiers {
if inputQualifier.Key == dbKey &&
inputQualifier.Value == dbValue {
found = true
break
}
Expand Down

0 comments on commit fb63f8e

Please sign in to comment.