From 3ad83b9d7edfbc8524c3090c75cd6a1d656f9f8c Mon Sep 17 00:00:00 2001 From: Vladimir Buyanov Date: Thu, 25 Jan 2024 14:21:02 +0200 Subject: [PATCH] Optimize filter order --- .goreleaser.yml | 1 - cli/setup.go | 56 ++++++++++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index acd51b5..e36f4a8 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -18,7 +18,6 @@ builds: - arm - arm64 goarm: - - 6 - 7 archives: - id: s3sync diff --git a/cli/setup.go b/cli/setup.go index 4adab8f..f159eac 100644 --- a/cli/setup.go +++ b/cli/setup.go @@ -101,6 +101,34 @@ func setupPipeline(syncGroup *pipeline.Group, cli *argsParsed) { }) } + if cli.FilterDirs { + syncGroup.AddPipeStep(pipeline.Step{ + Name: "FilterObjectsDirs", + Fn: collection.FilterObjectsDirs, + }) + } + + if cli.FilterDirsNot { + syncGroup.AddPipeStep(pipeline.Step{ + Name: "FilterObjectsDirsNot", + Fn: collection.FilterObjectsDirsNot, + }) + } + + if cli.FilterExist { + syncGroup.AddPipeStep(pipeline.Step{ + Name: "FilterObjectsExist", + Fn: collection.FilterObjectsExist, + }) + } + + if cli.FilterExistNot { + syncGroup.AddPipeStep(pipeline.Step{ + Name: "FilterObjectsExistNot", + Fn: collection.FilterObjectsExistNot, + }) + } + loadObjMetaStep := pipeline.Step{ Name: "LoadObjMeta", Fn: collection.LoadObjectMeta, @@ -129,20 +157,6 @@ func setupPipeline(syncGroup *pipeline.Group, cli *argsParsed) { }) } - if cli.FilterDirs { - syncGroup.AddPipeStep(pipeline.Step{ - Name: "FilterObjectsDirs", - Fn: collection.FilterObjectsDirs, - }) - } - - if cli.FilterDirsNot { - syncGroup.AddPipeStep(pipeline.Step{ - Name: "FilterObjectsDirsNot", - Fn: collection.FilterObjectsDirsNot, - }) - } - if len(cli.FilterCT) > 0 { syncGroup.AddPipeStep(pipeline.Step{ Name: "FilterObjByCT", @@ -166,20 +180,6 @@ func setupPipeline(syncGroup *pipeline.Group, cli *argsParsed) { }) } - if cli.FilterExist { - syncGroup.AddPipeStep(pipeline.Step{ - Name: "FilterObjectsExist", - Fn: collection.FilterObjectsExist, - }) - } - - if cli.FilterExistNot { - syncGroup.AddPipeStep(pipeline.Step{ - Name: "FilterObjectsExistNot", - Fn: collection.FilterObjectsExistNot, - }) - } - syncGroup.AddPipeStep(pipeline.Step{ Name: "LoadObjData", Fn: collection.LoadObjectData,