Remove an unnecessary "else" from the generated Thrift code.
authorDavid Reiss <dreiss@apache.org>
Fri, 21 Mar 2008 21:50:41 +0000 (21:50 +0000)
committerDavid Reiss <dreiss@apache.org>
Fri, 21 Mar 2008 21:50:41 +0000 (21:50 +0000)
The "if" block here always results in a return (or an exception),
so there is no need for an "else".  We can just put the rest of the code
under the "if" block.  This actually makes a little more sense because
the "if" block here is an exceptional case.

Also deleted a stale comment.

Reviewed By: lhastings

Test Plan: diff'ed the old and new code.

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

compiler/cpp/src/generate/t_cpp_generator.cc

index 9fee1bd..ef16243 100644 (file)
@@ -1970,12 +1970,8 @@ void t_cpp_generator::generate_service_processor(t_service* tservice) {
       indent() << "  return " << extends << "Processor::process_fn(iprot, oprot, fname, seqid);" << endl;
   }
   f_service_ <<
-    indent() << "} else {" << endl <<
-    indent() << "  (this->*(pfn->second))(seqid, iprot, oprot);" << endl <<
-    indent() << "}" << endl;
-
-  // Read end of args field, the T_STOP, and the struct close
-  f_service_ <<
+    indent() << "}" << endl <<
+    indent() << "(this->*(pfn->second))(seqid, iprot, oprot);" << endl <<
     indent() << "return true;" << endl;
 
   indent_down();