Skip to content

Commit 416a22f

Browse files
authored
Fix static fields count in skeleton generator (#25)
1 parent da00c4d commit 416a22f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

source/MetadataProcessor.Core/nanoSkeletonGenerator.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@ private void GenerateAssemblyHeader()
176176

177177
// static fields
178178
int fieldCount = 0;
179-
foreach (var f in c.Fields.Where(f => f.IsStatic && !f.HasConstant))
179+
var staticFields = c.Fields.Where(f => f.IsStatic && !f.HasConstant);
180+
staticFieldCount += staticFields.Count();
181+
182+
foreach (var f in staticFields)
180183
{
181184
classData.StaticFields.Add(new StaticField()
182185
{
@@ -245,8 +248,6 @@ private void GenerateAssemblyHeader()
245248
assemblyData.Classes.Add(classData);
246249
}
247250
}
248-
249-
staticFieldCount += c.Fields.Count(f => f.IsStatic);
250251
}
251252

252253
var stubble = new StubbleBuilder().Build();

0 commit comments

Comments
 (0)