Skip to content

Commit c514629

Browse files
committed
Почищен неиспользуемый код.
1 parent a2fa4ea commit c514629

File tree

4 files changed

+2
-23
lines changed

4 files changed

+2
-23
lines changed

src/ScriptEngine/Compiler/StackMachineCodeGenerator.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,6 @@ private BslPrimitiveValue MakeAnnotationParameterValueConstant(AnnotationParamet
11861186
var parameterValue = MakeAnnotationParameterValueConstant(parameter);
11871187
runtimeValue.Parameters.Add(new BslAnnotationParameter(parameter.Name, parameterValue));
11881188
}
1189-
var constNumber = CreateAnnotationConstDefinition(runtimeValue);
11901189
return runtimeValue;
11911190
}
11921191
else
@@ -1203,12 +1202,6 @@ private BslPrimitiveValue MakeAnnotationParameterValueConstant(AnnotationParamet
12031202
}
12041203
}
12051204

1206-
private int CreateAnnotationConstDefinition(BslAnnotationValue runtimeValue)
1207-
{
1208-
var result = RegisterAnnotationConst(runtimeValue);
1209-
return result;
1210-
}
1211-
12121205
private IEnumerable<BslAnnotationAttribute> GetAnnotations(AnnotatableNode parent)
12131206
{
12141207
return parent.Annotations.Select(a =>
@@ -1268,13 +1261,6 @@ private int GetConstNumber(in ConstDefinition cDef)
12681261
return idx;
12691262
}
12701263

1271-
private int RegisterAnnotationConst(BslAnnotationValue value)
1272-
{
1273-
var idx = _module.AnnotationValues.Count;
1274-
_module.AnnotationValues.Add(value);
1275-
return idx;
1276-
}
1277-
12781264
private int GetMethodRefNumber(in SymbolBinding methodBinding)
12791265
{
12801266
var idx = _module.MethodRefs.IndexOf(methodBinding);

src/ScriptEngine/Machine/AnnotationDefinition.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ This Source Code Form is subject to the terms of the
55
at http://mozilla.org/MPL/2.0/.
66
----------------------------------------------------------*/
77
using System;
8-
using System.Text;
98

109
namespace ScriptEngine.Machine
1110
{
@@ -14,7 +13,6 @@ public struct AnnotationDefinition
1413
{
1514
public string Name;
1615
public AnnotationParameter[] Parameters;
17-
18-
public int ParamCount => Parameters?.Length ?? 0;
16+
public readonly int ParamCount => Parameters?.Length ?? 0;
1917
}
2018
}

src/ScriptEngine/Machine/AnnotationParameter.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ public struct AnnotationParameter
1616

1717
[NonSerialized]
1818
public IValue RuntimeValue;
19-
20-
public const int UNDEFINED_VALUE_INDEX = -1;
2119

22-
23-
public override string ToString()
20+
public override readonly string ToString()
2421
{
2522
var list = new List<string>();
2623
if (!string.IsNullOrEmpty(Name))

src/ScriptEngine/Machine/StackRuntimeModule.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ public StackRuntimeModule(Type ownerType)
3131
internal IList<SymbolBinding> VariableRefs { get; } = new List<SymbolBinding>();
3232

3333
internal IList<SymbolBinding> MethodRefs { get; } = new List<SymbolBinding>();
34-
35-
internal IList<BslAnnotationValue> AnnotationValues { get; } = new List<BslAnnotationValue>();
3634

3735
#region IExecutableModule members
3836

0 commit comments

Comments
 (0)