diff options
author | Craig Tiller <ctiller@google.com> | 2016-07-13 15:40:24 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-07-13 15:40:24 -0700 |
commit | 22ac0d17c13a02ef4400700f5fe1af43c78d4931 (patch) | |
tree | 5c45770eaedb68fdbe42b5e5f54ae47446f61402 /src/compiler/generator_helpers.h | |
parent | c8a8513d5911e99241ec0bb7b038d4344110cb41 (diff) | |
parent | 8da7b1f779b36394008aad5ef40f49b03ce79c7b (diff) |
Merge branch 'delayed-write' into grand-unified-closures
Diffstat (limited to 'src/compiler/generator_helpers.h')
-rw-r--r-- | src/compiler/generator_helpers.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/compiler/generator_helpers.h b/src/compiler/generator_helpers.h index 9a88c2bfcc..88d96c0080 100644 --- a/src/compiler/generator_helpers.h +++ b/src/compiler/generator_helpers.h @@ -84,7 +84,7 @@ inline grpc::string StringReplace(grpc::string str, const grpc::string &from, } str.replace(pos, from.length(), to); pos += to.length(); - } while(replace_all); + } while (replace_all); return str; } @@ -139,8 +139,8 @@ inline grpc::string LowerUnderscoreToUpperCamel(grpc::string str) { return result; } -inline grpc::string FileNameInUpperCamel(const grpc::protobuf::FileDescriptor *file, - bool include_package_path) { +inline grpc::string FileNameInUpperCamel( + const grpc::protobuf::FileDescriptor *file, bool include_package_path) { std::vector<grpc::string> tokens = tokenize(StripProto(file->name()), "/"); grpc::string result = ""; if (include_package_path) { @@ -152,7 +152,8 @@ inline grpc::string FileNameInUpperCamel(const grpc::protobuf::FileDescriptor *f return result; } -inline grpc::string FileNameInUpperCamel(const grpc::protobuf::FileDescriptor *file) { +inline grpc::string FileNameInUpperCamel( + const grpc::protobuf::FileDescriptor *file) { return FileNameInUpperCamel(file, true); } @@ -163,7 +164,8 @@ enum MethodType { METHODTYPE_BIDI_STREAMING }; -inline MethodType GetMethodType(const grpc::protobuf::MethodDescriptor *method) { +inline MethodType GetMethodType( + const grpc::protobuf::MethodDescriptor *method) { if (method->client_streaming()) { if (method->server_streaming()) { return METHODTYPE_BIDI_STREAMING; @@ -254,7 +256,7 @@ inline grpc::string GenerateCommentsWithPrefix( const std::vector<grpc::string> &in, const grpc::string &prefix) { std::ostringstream oss; for (auto it = in.begin(); it != in.end(); it++) { - const grpc::string& elem = *it; + const grpc::string &elem = *it; if (elem.empty()) { oss << prefix << "\n"; } else if (elem[0] == ' ') { |