From 62f0d5428d00281ca412164c478c850cfa45305d Mon Sep 17 00:00:00 2001 From: David Reiss Date: Fri, 21 Mar 2008 21:50:41 +0000 Subject: [PATCH] Remove an unnecessary "else" from the generated Thrift code. 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 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/compiler/cpp/src/generate/t_cpp_generator.cc b/compiler/cpp/src/generate/t_cpp_generator.cc index 9fee1bdb..ef162432 100644 --- a/compiler/cpp/src/generate/t_cpp_generator.cc +++ b/compiler/cpp/src/generate/t_cpp_generator.cc @@ -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(); -- 2.17.1