Skip to content

Commit 7712b6d

Browse files
committed
Address feedback
1 parent 4f2f801 commit 7712b6d

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -659,14 +659,14 @@ private string GenerateFastPathFuncForObject(TypeGenerationSpec typeGenSpec, str
659659
sb.Append($@"{Environment.NewLine} ");
660660
}
661661

662-
sb.Append($@"{WriterVarName}.WriteStartObject();"); // writer.WriteNumber(""yo"", 45);
662+
sb.Append($@"{WriterVarName}.WriteStartObject();");
663663

664664
// Provide generation logic for each prop.
665665
Debug.Assert(serializableProperties != null);
666666

667667
foreach (PropertyGenerationSpec propertyGenSpec in serializableProperties.Values)
668668
{
669-
if (!ShouldIncludeForFastPath(propertyGenSpec, options))
669+
if (!ShouldIncludePropertyForFastPath(propertyGenSpec, options))
670670
{
671671
continue;
672672
}
@@ -739,7 +739,7 @@ private string GenerateFastPathFuncForObject(TypeGenerationSpec typeGenSpec, str
739739
return GenerateFastPathFuncForType(serializeMethodName, typeRef, sb.ToString(), typeGenSpec.CanBeNull);
740740
}
741741

742-
private static bool ShouldIncludeForFastPath(PropertyGenerationSpec propertyGenSpec, JsonSourceGenerationOptionsAttribute options)
742+
private static bool ShouldIncludePropertyForFastPath(PropertyGenerationSpec propertyGenSpec, JsonSourceGenerationOptionsAttribute options)
743743
{
744744
TypeGenerationSpec propertyTypeSpec = propertyGenSpec.TypeGenerationSpec;
745745

src/libraries/System.Text.Json/gen/Reflection/TypeWrapper.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ public override Type[] GetNestedTypes(BindingFlags bindingAttr)
314314
return nestedTypes.ToArray();
315315
}
316316

317-
// TODO: make sure to use bindingAttr for correctness. Current implementation assumes public and non-static.
318317
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
319318
{
320319
List<PropertyInfo> properties = new();
@@ -338,11 +337,6 @@ public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
338337
{
339338
properties.Add(new PropertyInfoWrapper(propertySymbol, _metadataLoadContext));
340339
}
341-
342-
//if ((item.DeclaredAccessibility & Accessibility.Public) == Accessibility.Public)
343-
//{
344-
// properties.Add(new PropertyInfoWrapper(property, _metadataLoadContext));
345-
//}
346340
}
347341
}
348342

0 commit comments

Comments
 (0)