[thrift] Move readMessageEnd inside of else block for accelerated protocol
authordweatherford <dev-null@apache.org>
Tue, 11 Mar 2008 02:42:45 +0000 (02:42 +0000)
committerdweatherford <dev-null@apache.org>
Tue, 11 Mar 2008 02:42:45 +0000 (02:42 +0000)
Summary: Otherwise, readMessageEnd will be performed twice; once in the extension and once in PHP-land. Since TBinaryProtocol readMessageEnd is a no-op this isn't a huge deal, but it's bad style.
Reviewed By: mcslee
Test Plan: Inspect generated php code
Revert: OK
TracCamp Project: Thrift
DiffCamp Revision: 9155

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

compiler/cpp/src/generate/t_php_generator.cc

index 0d2e31f..99b207f 100644 (file)
@@ -1287,14 +1287,13 @@ void t_php_generator::_generate_service_client(ofstream& out, t_service* tservic
         indent() << "$result = new " << resultname << "();" << endl <<
         indent() << "$result->read($this->input_);" << endl;
 
-      scope_down(out);
-
       if (!binary_inline_) {
         out <<
-          indent() << "$this->input_->readMessageEnd();" << endl <<
-          endl;
+          indent() << "$this->input_->readMessageEnd();" << endl;
       }
 
+      scope_down(out);
+
       // Careful, only return result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
         out <<