Browse Source

clean code

pull/640/head
13291271729 3 years ago
parent
commit
dcbbc48f5e
2 changed files with 9 additions and 9 deletions
  1. +2
    -2
      parser/common/convert/message2operator.cc
  2. +7
    -7
      parser/common/convert/message2operator.h

+ 2
- 2
parser/common/convert/message2operator.cc View File

@@ -139,7 +139,7 @@ Status Message2Operator::ParseField(const google::protobuf::Reflection *reflecti
void Message2Operator::ParseRepeatedBaseTypeField(const google::protobuf::Reflection *reflection, void Message2Operator::ParseRepeatedBaseTypeField(const google::protobuf::Reflection *reflection,
const google::protobuf::Message *message, const google::protobuf::Message *message,
const google::protobuf::FieldDescriptor *field, const google::protobuf::FieldDescriptor *field,
ge::Operator &ops) {
ge::Operator &ops, const int field_size) {
switch (field->cpp_type()) { switch (field->cpp_type()) {
case google::protobuf::FieldDescriptor::CPPTYPE_INT32: { case google::protobuf::FieldDescriptor::CPPTYPE_INT32: {
std::vector<int32_t> attr_value; std::vector<int32_t> attr_value;
@@ -213,7 +213,7 @@ Status Message2Operator::ParseRepeatedField(const google::protobuf::Reflection *
return FAILED; return FAILED;
} }


ParseRepeatedBaseTypeField(reflection, message, field, ops);
ParseRepeatedBaseTypeField(reflection, message, field, ops, field_size);
switch (field->cpp_type()) { switch (field->cpp_type()) {
case google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE: { case google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE: {
nlohmann::json message_json; nlohmann::json message_json;


+ 7
- 7
parser/common/convert/message2operator.h View File

@@ -34,14 +34,14 @@ class Message2Operator {
const google::protobuf::Message *message, const google::protobuf::Message *message,
const google::protobuf::FieldDescriptor *field, ge::Operator &ops); const google::protobuf::FieldDescriptor *field, ge::Operator &ops);


void ParseBaseTypeField(const google::protobuf::Reflection *reflection,
const google::protobuf::Message *message,
const google::protobuf::FieldDescriptor *field, ge::Operator &ops);
static void ParseBaseTypeField(const google::protobuf::Reflection *reflection,
const google::protobuf::Message *message,
const google::protobuf::FieldDescriptor *field, ge::Operator &ops);


void ParseRepeatedBaseTypeField(const google::protobuf::Reflection *reflection,
const google::protobuf::Message *message,
const google::protobuf::FieldDescriptor *field,
ge::Operator &ops);
static void ParseRepeatedBaseTypeField(const google::protobuf::Reflection *reflection,
const google::protobuf::Message *message,
const google::protobuf::FieldDescriptor *field,
ge::Operator &ops);
}; };
} // namespace ge } // namespace ge
#endif // PARSER_MESSAGE2OPERATOR_H #endif // PARSER_MESSAGE2OPERATOR_H

Loading…
Cancel
Save