thrift-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dre...@apache.org
Subject svn commit: r769123 - /incubator/thrift/trunk/compiler/cpp/src/generate/t_py_generator.cc
Date Mon, 27 Apr 2009 19:36:50 GMT
Author: dreiss
Date: Mon Apr 27 19:36:50 2009
New Revision: 769123

URL: http://svn.apache.org/viewvc?rev=769123&view=rev
Log:
THRIFT-463. python: Fix thrift_spec ordering bug from r760201

Modified:
    incubator/thrift/trunk/compiler/cpp/src/generate/t_py_generator.cc

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_py_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_py_generator.cc?rev=769123&r1=769122&r2=769123&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_py_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_py_generator.cc Mon Apr 27 19:36:50
2009
@@ -531,6 +531,7 @@
                                                    bool is_result) {
 
   const vector<t_field*>& members = tstruct->get_members();
+  const vector<t_field*>& sorted_members = tstruct->get_sorted_members();
   vector<t_field*>::const_iterator m_iter;
 
   out <<
@@ -571,12 +572,12 @@
   // for structures with no members.
   // TODO(dreiss): Test encoding of structs where some inner structs
   // don't have thrift_spec.
-  if (members.empty() || (members[0]->get_key() >= 0)) {
+  if (sorted_members.empty() || (sorted_members[0]->get_key() >= 0)) {
     indent(out) << "thrift_spec = (" << endl;
     indent_up();
 
     int sorted_keys_pos = 0;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
+    for (m_iter = sorted_members.begin(); m_iter != sorted_members.end(); ++m_iter) {
 
       for (; sorted_keys_pos != (*m_iter)->get_key(); sorted_keys_pos++) {
         indent(out) << "None, # " << sorted_keys_pos << endl;



Mime
View raw message