Use rvalue ref return to avoid copy

pull/2428/head
vjpai 10 years ago
parent c7eed74dc4
commit f77ab15c57
  1. 4
      src/compiler/objective_c_generator.cc

@ -100,14 +100,14 @@ void PrintAdvancedSignature(Printer *printer,
PrintMethodSignature(printer, method, vars);
}
inline map<string, string> GetMethodVars(const MethodDescriptor *method) {
inline map<string, string>&& GetMethodVars(const MethodDescriptor *method) {
map<string,string> res;
res["method_name"] = method->name();
res["request_type"] = method->input_type()->name();
res["response_type"] = method->output_type()->name();
res["request_class"] = ClassName(method->input_type());
res["response_class"] = ClassName(method->output_type());
return res;
return std::forward<map<string,string>>(res);
}
void PrintMethodDeclarations(Printer *printer,

Loading…
Cancel
Save