summaryrefslogtreecommitdiffstats
path: root/contrib/libs/grpc/src/compiler/python_generator_helpers.h
diff options
context:
space:
mode:
authordvshkurko <[email protected]>2022-02-10 16:45:51 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:51 +0300
commit321ee9bce31ec6e238be26dbcbe539cffa2c3309 (patch)
tree14407a2757cbf29eb97e266b7f07e851f971000c /contrib/libs/grpc/src/compiler/python_generator_helpers.h
parent2f6ca198245aeffd5e2d82b65927c2465b68b4f5 (diff)
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/grpc/src/compiler/python_generator_helpers.h')
-rw-r--r--contrib/libs/grpc/src/compiler/python_generator_helpers.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/contrib/libs/grpc/src/compiler/python_generator_helpers.h b/contrib/libs/grpc/src/compiler/python_generator_helpers.h
index 78e7efd7e0d..c14b1bc3da1 100644
--- a/contrib/libs/grpc/src/compiler/python_generator_helpers.h
+++ b/contrib/libs/grpc/src/compiler/python_generator_helpers.h
@@ -52,15 +52,15 @@ typedef vector<TString> StringVector;
static TString StripModulePrefixes(
const TString& raw_module_name,
const std::vector<TString>& prefixes_to_filter) {
- for (const auto& prefix : prefixes_to_filter) {
- if (raw_module_name.rfind(prefix, 0) == 0) {
- return raw_module_name.substr(prefix.size(),
- raw_module_name.size() - prefix.size());
- }
- }
- return raw_module_name;
-}
-
+ for (const auto& prefix : prefixes_to_filter) {
+ if (raw_module_name.rfind(prefix, 0) == 0) {
+ return raw_module_name.substr(prefix.size(),
+ raw_module_name.size() - prefix.size());
+ }
+ }
+ return raw_module_name;
+}
+
// TODO(https://github.com/google/protobuf/issues/888):
// Export `ModuleName` from protobuf's
// `src/google/protobuf/compiler/python/python_generator.cc` file.
@@ -70,8 +70,8 @@ TString ModuleName(const TString& filename,
TString basename = StripProto(filename);
basename = StringReplace(basename, "-", "_");
basename = StringReplace(basename, "/", ".");
- return StripModulePrefixes(import_prefix + basename + "_pb2",
- prefixes_to_filter);
+ return StripModulePrefixes(import_prefix + basename + "_pb2",
+ prefixes_to_filter);
}
// TODO(https://github.com/google/protobuf/issues/888):
@@ -90,7 +90,7 @@ TString ModuleAlias(const TString& filename,
return module_name;
}
-bool GetModuleAndMessagePath(
+bool GetModuleAndMessagePath(
const Descriptor* type, TString* out, TString generator_file_name,
bool generate_in_pb2_grpc, TString& import_prefix,
const std::vector<TString>& prefixes_to_filter) {
@@ -138,14 +138,14 @@ StringVector get_all_comments(const DescriptorType* descriptor) {
inline void Split(const TString& s, char delim,
std::vector<TString>* append_to) {
- auto current = s.begin();
- while (current <= s.end()) {
- auto next = std::find(current, s.end(), delim);
- append_to->emplace_back(current, next);
- current = next + 1;
- }
-}
-
+ auto current = s.begin();
+ while (current <= s.end()) {
+ auto next = std::find(current, s.end(), delim);
+ append_to->emplace_back(current, next);
+ current = next + 1;
+ }
+}
+
} // namespace
} // namespace grpc_python_generator