Skip to content

Commit 3ad83b9

Browse files
committed
Optimize filter order
1 parent a621c7f commit 3ad83b9

File tree

2 files changed

+28
-29
lines changed

2 files changed

+28
-29
lines changed

.goreleaser.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ builds:
1818
- arm
1919
- arm64
2020
goarm:
21-
- 6
2221
- 7
2322
archives:
2423
- id: s3sync

cli/setup.go

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,34 @@ func setupPipeline(syncGroup *pipeline.Group, cli *argsParsed) {
101101
})
102102
}
103103

104+
if cli.FilterDirs {
105+
syncGroup.AddPipeStep(pipeline.Step{
106+
Name: "FilterObjectsDirs",
107+
Fn: collection.FilterObjectsDirs,
108+
})
109+
}
110+
111+
if cli.FilterDirsNot {
112+
syncGroup.AddPipeStep(pipeline.Step{
113+
Name: "FilterObjectsDirsNot",
114+
Fn: collection.FilterObjectsDirsNot,
115+
})
116+
}
117+
118+
if cli.FilterExist {
119+
syncGroup.AddPipeStep(pipeline.Step{
120+
Name: "FilterObjectsExist",
121+
Fn: collection.FilterObjectsExist,
122+
})
123+
}
124+
125+
if cli.FilterExistNot {
126+
syncGroup.AddPipeStep(pipeline.Step{
127+
Name: "FilterObjectsExistNot",
128+
Fn: collection.FilterObjectsExistNot,
129+
})
130+
}
131+
104132
loadObjMetaStep := pipeline.Step{
105133
Name: "LoadObjMeta",
106134
Fn: collection.LoadObjectMeta,
@@ -129,20 +157,6 @@ func setupPipeline(syncGroup *pipeline.Group, cli *argsParsed) {
129157
})
130158
}
131159

132-
if cli.FilterDirs {
133-
syncGroup.AddPipeStep(pipeline.Step{
134-
Name: "FilterObjectsDirs",
135-
Fn: collection.FilterObjectsDirs,
136-
})
137-
}
138-
139-
if cli.FilterDirsNot {
140-
syncGroup.AddPipeStep(pipeline.Step{
141-
Name: "FilterObjectsDirsNot",
142-
Fn: collection.FilterObjectsDirsNot,
143-
})
144-
}
145-
146160
if len(cli.FilterCT) > 0 {
147161
syncGroup.AddPipeStep(pipeline.Step{
148162
Name: "FilterObjByCT",
@@ -166,20 +180,6 @@ func setupPipeline(syncGroup *pipeline.Group, cli *argsParsed) {
166180
})
167181
}
168182

169-
if cli.FilterExist {
170-
syncGroup.AddPipeStep(pipeline.Step{
171-
Name: "FilterObjectsExist",
172-
Fn: collection.FilterObjectsExist,
173-
})
174-
}
175-
176-
if cli.FilterExistNot {
177-
syncGroup.AddPipeStep(pipeline.Step{
178-
Name: "FilterObjectsExistNot",
179-
Fn: collection.FilterObjectsExistNot,
180-
})
181-
}
182-
183183
syncGroup.AddPipeStep(pipeline.Step{
184184
Name: "LoadObjData",
185185
Fn: collection.LoadObjectData,

0 commit comments

Comments
 (0)