Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps update - fixes clustering and compression #73

Merged
merged 1 commit into from
Mar 19, 2024
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: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ module github.com/s0rg/decompose
go 1.22

require (
github.com/docker/docker v25.0.4+incompatible
github.com/docker/docker v25.0.5+incompatible
github.com/emicklei/dot v1.6.1
github.com/expr-lang/expr v1.16.1
github.com/prometheus/procfs v0.13.0
github.com/s0rg/set v1.2.0
github.com/s0rg/trie v1.3.0
github.com/s0rg/trie v1.3.1
gopkg.in/yaml.v3 v3.0.1
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/docker v25.0.4+incompatible h1:XITZTrq+52tZyZxUOtFIahUf3aH367FLxJzt9vZeAF8=
github.com/docker/docker v25.0.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE=
github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
Expand Down Expand Up @@ -64,8 +64,8 @@ github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBO
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/s0rg/set v1.2.0 h1:53b207YMktNQJXYei/oHuTR5oOO2e9+eieZOncYsh9g=
github.com/s0rg/set v1.2.0/go.mod h1:xz3nDbjF4nyMLvAHvmE7rigXpNrKKTsi6iANznIB1/4=
github.com/s0rg/trie v1.3.0 h1:VeMjAJdVvAMt06QlrLJs9B7tplwyxGtCPPZHfvW4Duo=
github.com/s0rg/trie v1.3.0/go.mod h1:P+hJUWvPu/imKrsdzOrVswr8Mme6GgFtZfBKojYYkfk=
github.com/s0rg/trie v1.3.1 h1:O9THfLSiXqBN08gJoHegwdkkaGIIs3GnXlYQswfXWTk=
github.com/s0rg/trie v1.3.1/go.mod h1:BGS9ZEqxUvxDT+4qai+YZnzvUDvTpJrx8zBtP7LBjS8=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
Expand Down
10 changes: 6 additions & 4 deletions internal/graph/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
"slices"
"strings"

"github.com/s0rg/decompose/internal/node"
"github.com/s0rg/set"
"github.com/s0rg/trie"

"github.com/s0rg/decompose/internal/node"
)

const (
Expand Down Expand Up @@ -83,8 +84,11 @@ func (c *Compressor) Write(w io.Writer) (err error) {
}

func (c *Compressor) buildGroups() (index map[string]string, err error) {
seen := make(set.Unordered[string])
index = make(map[string]string)
groups := make(map[string][]string)

t := trie.New[string]()
seen := make(set.Unordered[string])

for _, node := range c.nodes {
seen.Add(node.ID)
Expand All @@ -97,8 +101,6 @@ func (c *Compressor) buildGroups() (index map[string]string, err error) {
}

comm := t.Common("", defaultDiff)
groups := make(map[string][]string)
index = make(map[string]string)

for _, key := range comm {
nodes := []string{}
Expand Down
Loading