소스 검색

address a few TODOs

Jan Tattermusch 5 년 전
부모
커밋
c06812b0b2
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      csharp/src/Google.Protobuf.Test/FieldCodecTest.cs

+ 2 - 4
csharp/src/Google.Protobuf.Test/FieldCodecTest.cs

@@ -124,11 +124,10 @@ namespace Google.Protobuf
             {
                 var stream = new MemoryStream();
                 var codedOutput = new CodedOutputStream(stream);
-
-                // TODO: simplify
                 WriteContext.Initialize(codedOutput, out WriteContext ctx);
                 try
                 {
+                    // only write the value using the codec
                     codec.ValueWriter(ref ctx, sampleValue);
                 }
                 finally
@@ -186,11 +185,10 @@ namespace Google.Protobuf
                 if (codec.DefaultValue != null) // This part isn't appropriate for message types.
                 {
                     codedOutput = new CodedOutputStream(stream);
-
-                    // TODO: simplify
                     WriteContext.Initialize(codedOutput, out WriteContext ctx);
                     try
                     {
+                        // only write the value using the codec
                         codec.ValueWriter(ref ctx, codec.DefaultValue);
                     }
                     finally