mozilla-services/powerhose — Issue #8: Consider using references instead of pointers
Author: indygreg
Created: 2012-03-01 22:55:41+00:00
State: open

virtual void execute(vector* vreq, vector* vres);

I would consider rewriting this as:

virtual void execute(::std::vector< ::std::string > &vreq, ::std::vector< ::std::string > &vres);

Passing references is functionally equivalent to passing a pointer (still pass by reference, not pass by value). And, it saves you some work in the implementation of having to check for NULL pointers.

Please note I used the fully qualified symbol names in my example because once the "using" statement goes away from the header (issue #4), this is what you'll have to do. And, if you choose to get with the leading "::", you'll need an extra space between the "<" and "::" to appease the compiler.