Source code refactoring. Extracted common functionality into merged methods

Source code refactoring. Extracted common functionality into merged methods
On Tue, Dec 9, 2014 at 10:05 PM, krishnanm86 <notifications@github.com>
wrote:

> In src/google/protobuf/compiler/python/python_generator.cc
> <https://github.com/google/protobuf/pull/126#discussion-diff-21585640>:
>
> > @@ -580,39 +580,34 @@ void Generator::PrintServiceDescriptor(
> >    printer_->Print("])\n\n");
> >  }
> >
> > +
> > +void Generator::printService(const ServiceDescriptor& descriptor, bool stub,bool cls) const{
> > +	if (stub)
> > +		printer_->Print(
>
> Would it be acceptable if I : 1) Fix the tabs/ other google casing issues
> 2) Change the X into Symbol 3) Make the PrintService take just one string
> parameter instead of multiple booleans?
>
I suggest keeping the original two PrintServiceStub() PrintServiceClass()
method and extract the common part of these two methods to a
PrintDescirptorKeyAndModuleName() mehtod.


> … <#14a32cdc580b1f73_>
> On Tue, Dec 9, 2014 at 11:34 PM, Feng Xiao <notifications@github.com>
> wrote: In src/google/protobuf/compiler/python/python_generator.cc <
> https://github.com/google/protobuf/pull/126#discussion-diff-21568852>: >
> @@ -580,39 +580,34 @@ void Generator::PrintServiceDescriptor( >
> printer_->Print("])\n\n"); > } > > + > +void Generator::printService(const
> ServiceDescriptor& descriptor, bool stub,bool cls) const{ > + if (stub) > +
> printer_->Print( Google C++ Style Guide forbids the use of tab. Code should
> be indented using spaces. — Reply to this email directly or view it on
> GitHub <https://github.com/google/protobuf/pull/126/files#r21568852>.
>  -- ----------------------------------------------------- I dare do all
> that may become a man; Who dares do more, is none - Macbeth, twelfh night!
> Regards Krishna
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/google/protobuf/pull/126/files#r21585640>.
>