THRIFT-1120. csharp: proto.WriteListEnd being called in the wrong place
authorBryan Duxbury <bryanduxbury@apache.org>
Mon, 28 Mar 2011 14:52:25 +0000 (14:52 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Mon, 28 Mar 2011 14:52:25 +0000 (14:52 +0000)
Patch: guoyunfeng

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1086260 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_csharp_generator.cc

index 45ed646..93a39f9 100644 (file)
@@ -1488,6 +1488,8 @@ void t_csharp_generator::generate_serialize_container(ofstream& out, t_type* tty
     generate_serialize_list_element(out, (t_list*)ttype, iter);
   }
 
+  scope_down(out);
+
   if (ttype->is_map()) {
     indent(out) << "oprot.WriteMapEnd();" << endl;
   } else if (ttype->is_set()) {
@@ -1497,7 +1499,6 @@ void t_csharp_generator::generate_serialize_container(ofstream& out, t_type* tty
   }
 
   scope_down(out);
-  scope_down(out);
 }
 
 void t_csharp_generator::generate_serialize_map_element(ofstream& out, t_map* tmap, string iter, string map) {