diff options
author | dvshkurko <[email protected]> | 2022-02-10 16:45:51 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:51 +0300 |
commit | 321ee9bce31ec6e238be26dbcbe539cffa2c3309 (patch) | |
tree | 14407a2757cbf29eb97e266b7f07e851f971000c /contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h | |
parent | 2f6ca198245aeffd5e2d82b65927c2465b68b4f5 (diff) |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h')
-rw-r--r-- | contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h b/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h index 956539f392a..b5109d0d2fa 100644 --- a/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h +++ b/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h @@ -100,30 +100,30 @@ inline TString Modularize(TString s) { return new_string; } -// RubyPackage gets the ruby package in either proto or ruby_package format +// RubyPackage gets the ruby package in either proto or ruby_package format inline TString RubyPackage(const grpc::protobuf::FileDescriptor* file) { TString package_name = file->package(); - if (file->options().has_ruby_package()) { - package_name = file->options().ruby_package(); - - // If :: is in the package convert the Ruby formatted name - // -> A::B::C - // to use the dot seperator notation - // -> A.B.C - package_name = ReplaceAll(package_name, "::", "."); - } - return package_name; -} - + if (file->options().has_ruby_package()) { + package_name = file->options().ruby_package(); + + // If :: is in the package convert the Ruby formatted name + // -> A::B::C + // to use the dot seperator notation + // -> A.B.C + package_name = ReplaceAll(package_name, "::", "."); + } + return package_name; +} + // RubyTypeOf updates a proto type to the required ruby equivalent. inline TString RubyTypeOf(const grpc::protobuf::Descriptor* descriptor) { TString proto_type = descriptor->full_name(); - if (descriptor->file()->options().has_ruby_package()) { + if (descriptor->file()->options().has_ruby_package()) { // remove the leading package if present ReplacePrefix(&proto_type, descriptor->file()->package(), ""); ReplacePrefix(&proto_type, ".", ""); // remove the leading . (no package) proto_type = RubyPackage(descriptor->file()) + "." + proto_type; - } + } TString res("." + proto_type); if (res.find('.') == TString::npos) { return res; |