Skip to content

legacy: some clean-ups of legacy code #2160

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

Merged
merged 4 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Removed unused structs
  • Loading branch information
cmaglie committed Apr 27, 2023
commit 5d5cd18b6459361659ee717610ac0385c4c6beb4
34 changes: 0 additions & 34 deletions legacy/builder/test/unique_string_queue_test.go

This file was deleted.

23 changes: 0 additions & 23 deletions legacy/builder/types/accessories.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,6 @@ package types

import "golang.org/x/exp/slices"

type UniqueStringQueue []string

func (queue UniqueStringQueue) Len() int { return len(queue) }
func (queue UniqueStringQueue) Less(i, j int) bool { return false }
func (queue UniqueStringQueue) Swap(i, j int) { panic("Who called me?!?") }

func (queue *UniqueStringQueue) Push(value string) {
if !slices.Contains(*queue, value) {
*queue = append(*queue, value)
}
}

func (queue *UniqueStringQueue) Pop() interface{} {
old := *queue
x := old[0]
*queue = old[1:]
return x
}

func (queue *UniqueStringQueue) Empty() bool {
return queue.Len() == 0
}

type UniqueSourceFileQueue []SourceFile

func (queue UniqueSourceFileQueue) Len() int { return len(queue) }
Expand Down
32 changes: 0 additions & 32 deletions legacy/builder/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,38 +85,6 @@ func (f *SourceFile) DepfilePath(ctx *Context) *paths.Path {
return buildRoot(ctx, f.Origin).Join(f.RelativePath.String() + ".d")
}

type SketchFile struct {
Name *paths.Path
}

type SketchFileSortByName []SketchFile

func (s SketchFileSortByName) Len() int {
return len(s)
}

func (s SketchFileSortByName) Swap(i, j int) {
s[i], s[j] = s[j], s[i]
}

func (s SketchFileSortByName) Less(i, j int) bool {
return s[i].Name.String() < s[j].Name.String()
}

type PlatforKeysRewrite struct {
Rewrites []PlatforKeyRewrite
}

func (p *PlatforKeysRewrite) Empty() bool {
return len(p.Rewrites) == 0
}

type PlatforKeyRewrite struct {
Key string
OldValue string
NewValue string
}

type Prototype struct {
FunctionName string
File string
Expand Down