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

Remove unused steps #863

Merged
merged 2 commits into from
Mar 14, 2023
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
7 changes: 1 addition & 6 deletions src/ExRam.Gremlinq.Core/Serialization/Serializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,16 +422,12 @@ static void AddInnerInstruction(Instruction instruction, Bytecode byteCode, IGre
{
var traversal = step.Traversal;

if (traversal.Count == 1 && traversal[0] is LocalStep localStep)
if (traversal is [LocalStep localStep])
traversal = localStep.Traversal;

return CreateInstruction("by", recurse, env, traversal);
})
.Add<ProjectStep.ByKeyStep>(static (step, env, recurse) => CreateInstruction("by", recurse, env, step.Key))
.Add(Create<ProjectVertexStep, Traversal>(static (_, env, _) => env.Options.GetValue(env.FeatureSet.Supports(VertexFeatures.MetaProperties)
? GremlinqOption.VertexProjectionSteps
: GremlinqOption.VertexProjectionWithoutMetaPropertiesSteps)))
.Add(Create<ProjectEdgeStep, Traversal>(static (_, env, _) => env.Options.GetValue(GremlinqOption.EdgeProjectionSteps)))
.Add<RangeStep>(static (step, env, recurse) => step.Scope.Equals(Scope.Local)
? CreateInstruction("range", recurse, env, step.Scope, step.Lower, step.Upper)
: CreateInstruction("range", recurse, env, step.Lower, step.Upper))
Expand Down Expand Up @@ -459,7 +455,6 @@ static void AddInnerInstruction(Instruction instruction, Bytecode byteCode, IGre
.Add<ValuesStep>(static (step, env, recurse) => CreateInstruction("values", recurse, env, step.Keys))
.Add<VStep>(static (step, env, recurse) => CreateInstruction("V", recurse, env, step.Ids))
.Add<WhereTraversalStep>(static (step, env, recurse) => CreateInstruction("where", recurse, env, step.Traversal))
.Add<WithStrategiesStep>(static (step, env, recurse) => CreateInstruction("withStrategies", recurse, env, step.Traversal))
.Add<WithoutStrategiesStep>(static (step, env, recurse) => CreateInstruction("withoutStrategies", recurse, env, step.StrategyTypes))
.Add<WithSideEffectStep>(static (step, env, recurse) => CreateInstruction("withSideEffect", recurse, env, step.Label, step.Value))
.Add<WherePredicateStep>(static (step, env, recurse) => CreateInstruction("where", recurse, env, step.Predicate))
Expand Down
7 changes: 0 additions & 7 deletions src/ExRam.Gremlinq.Core/Steps/ProjectEdgeStep.cs

This file was deleted.

7 changes: 0 additions & 7 deletions src/ExRam.Gremlinq.Core/Steps/ProjectVertexStep.cs

This file was deleted.

12 changes: 0 additions & 12 deletions src/ExRam.Gremlinq.Core/Steps/WithStrategiesStep.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -822,15 +822,6 @@
OperatorName: profile
}
},
{
Item1: ProjectEdgeStep,
Item2: {
Count: 4,
Projection: {
Name: ExRam.Gremlinq.Core.Projections.EmptyProjection
}
}
},
{
Item1: ProjectStep,
Item2: {
Expand Down Expand Up @@ -869,15 +860,6 @@
]
}
},
{
Item1: ProjectVertexStep,
Item2: {
Count: 4,
Projection: {
Name: ExRam.Gremlinq.Core.Projections.EmptyProjection
}
}
},
{
Item1: PropertiesStep,
Item2: {
Expand Down Expand Up @@ -1201,20 +1183,5 @@
string
]
}
},
{
Item1: WithStrategiesStep,
Item2: {
OperatorName: withStrategies,
Arguments: [
{
StepInstructions: [
{
OperatorName: identity
}
]
}
]
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,6 @@
Item1: ProfileStep,
Item2: {}
},
{
Item1: ProjectEdgeStep,
Item2: {}
},
{
Item1: ProjectStep,
Item2: {
Expand Down Expand Up @@ -724,10 +720,6 @@
}
}
},
{
Item1: ProjectVertexStep,
Item2: {}
},
{
Item1: PropertiesStep,
Item2: {
Expand Down Expand Up @@ -1015,16 +1007,5 @@
Value: string,
Label: {}
}
},
{
Item1: WithStrategiesStep,
Item2: {
Traversal: {
Count: 1,
Projection: {
Name: ExRam.Gremlinq.Core.Projections.EmptyProjection
}
}
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2006,11 +2006,6 @@ public sealed class ProfileStep : ExRam.Gremlinq.Core.Steps.Step
public static readonly ExRam.Gremlinq.Core.Steps.ProfileStep Instance;
public ProfileStep() { }
}
public sealed class ProjectEdgeStep : ExRam.Gremlinq.Core.Steps.Step
{
public static readonly ExRam.Gremlinq.Core.Steps.ProjectEdgeStep Instance;
public ProjectEdgeStep() { }
}
public sealed class ProjectStep : ExRam.Gremlinq.Core.Steps.Step
{
public ProjectStep(System.Collections.Immutable.ImmutableArray<string> projections) { }
Expand All @@ -2033,11 +2028,6 @@ public sealed class ByTraversalStep : ExRam.Gremlinq.Core.Steps.ProjectStep.BySt
public override ExRam.Gremlinq.Core.Steps.ProjectStep.ByTraversalStep ToByTraversalStep() { }
}
}
public sealed class ProjectVertexStep : ExRam.Gremlinq.Core.Steps.Step
{
public static readonly ExRam.Gremlinq.Core.Steps.ProjectVertexStep Instance;
public ProjectVertexStep() { }
}
public sealed class PropertiesStep : ExRam.Gremlinq.Core.Steps.Step
{
public PropertiesStep(System.Collections.Immutable.ImmutableArray<string> keys) { }
Expand Down Expand Up @@ -2204,11 +2194,6 @@ public sealed class WithSideEffectStep : ExRam.Gremlinq.Core.Steps.Step
public ExRam.Gremlinq.Core.StepLabel Label { get; }
public object Value { get; }
}
public sealed class WithStrategiesStep : ExRam.Gremlinq.Core.Steps.Step
{
public WithStrategiesStep(ExRam.Gremlinq.Core.Traversal traversal) { }
public ExRam.Gremlinq.Core.Traversal Traversal { get; }
}
public sealed class WithoutStrategiesStep : ExRam.Gremlinq.Core.Steps.Step
{
public WithoutStrategiesStep(System.Collections.Immutable.ImmutableArray<System.Type> strategyTypes) { }
Expand Down