-
Notifications
You must be signed in to change notification settings - Fork 236
Adding size sorting for package and file differs/analyzers #36
Conversation
type StrPackageInfo struct { | ||
type PackageOutput struct { | ||
Name string | ||
Path string `json:",omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a little strange to me, should that comma be there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, because prior to the comma should go the field name you want displayed, but if if you don't specify anything, it defaults to the struct's field name, and I'm just keeping it the same here
utils/diff_output_utils.go
Outdated
|
||
func (r DirDiffResult) GetStruct() DiffResult { | ||
func (r DirDiffResult) OutputStruct() interface{} { | ||
r.Diff = sortDirDiff(r.Diff.(DirDiff)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error check for this type cast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
utils/output_sort_utils.go
Outdated
|
||
// Sorts MultiVersionInfos by package instance with the largest size in the first image, in descending order | ||
var singleInfoSizeSort = func(a, b *Info) bool { | ||
aInfo1 := a.Info1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these variable assignments necessary?
utils/output_sort_utils.go
Outdated
} | ||
|
||
func (s *multiVersionInfoSorter) Swap(i, j int) { | ||
s.packageDiffs[i], s.packageDiffs[j] = s.packageDiffs[i], s.packageDiffs[j] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless I'm missing something here, you have these backwards
utils/output_sort_utils.go
Outdated
} | ||
|
||
func (s *entryDiffSorter) Swap(i, j int) { | ||
s.entryDiffs[i], s.entryDiffs[j] = s.entryDiffs[i], s.entryDiffs[j] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are backwards as well I believe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, my bad... fixed now.
can you draft a new release in Github and put this in the release notes? don't want to forget to mention this :) |
will do :) this and single image analysis i guess? |
fixes #29
@aaron-prindle @nkubala