mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-02 03:54:00 +00:00
Clean up extra white spaces (#7800)
* Clean up extra white spaces * update Co-authored-by: Wen Sun <sunwen@google.com> Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -2278,7 +2278,7 @@ class CppGenerator : public BaseGenerator {
|
|||||||
code_ +=
|
code_ +=
|
||||||
space + "const auto {{RHS}} = {{RHS_PREFIX}}.{{CURR_FIELD_NAME}}();";
|
space + "const auto {{RHS}} = {{RHS_PREFIX}}.{{CURR_FIELD_NAME}}();";
|
||||||
if (is_scalar) {
|
if (is_scalar) {
|
||||||
code_ += space + "if ({{LHS}} != {{RHS}})";
|
code_ += space + "if ({{LHS}} != {{RHS}})";
|
||||||
code_ += space +
|
code_ += space +
|
||||||
" return static_cast<int>({{LHS}} > {{RHS}}) - "
|
" return static_cast<int>({{LHS}} > {{RHS}}) - "
|
||||||
"static_cast<int>({{LHS}} < {{RHS}});";
|
"static_cast<int>({{LHS}} < {{RHS}});";
|
||||||
@@ -2343,7 +2343,7 @@ class CppGenerator : public BaseGenerator {
|
|||||||
} else if (is_array) {
|
} else if (is_array) {
|
||||||
const auto &elem_type = field.value.type.VectorType();
|
const auto &elem_type = field.value.type.VectorType();
|
||||||
std::string input_type = "::flatbuffers::Array<" +
|
std::string input_type = "::flatbuffers::Array<" +
|
||||||
GenTypeGet(elem_type, "", "", " ", false) +
|
GenTypeGet(elem_type, "", "", "", false) +
|
||||||
", " + NumToString(elem_type.fixed_length) + ">";
|
", " + NumToString(elem_type.fixed_length) + ">";
|
||||||
code_.SetValue("INPUT_TYPE", input_type);
|
code_.SetValue("INPUT_TYPE", input_type);
|
||||||
code_ +=
|
code_ +=
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Apple FLATBUFFERS_FINAL_CLASS {
|
|||||||
return rgb_compare_result;
|
return rgb_compare_result;
|
||||||
const auto lhs_color_tag = lhs_color.tag();
|
const auto lhs_color_tag = lhs_color.tag();
|
||||||
const auto rhs_color_tag = rhs_color.tag();
|
const auto rhs_color_tag = rhs_color.tag();
|
||||||
if (lhs_color_tag != rhs_color_tag)
|
if (lhs_color_tag != rhs_color_tag)
|
||||||
return static_cast<int>(lhs_color_tag > rhs_color_tag) - static_cast<int>(lhs_color_tag < rhs_color_tag);
|
return static_cast<int>(lhs_color_tag > rhs_color_tag) - static_cast<int>(lhs_color_tag < rhs_color_tag);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -381,7 +381,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Fruit FLATBUFFERS_FINAL_CLASS {
|
|||||||
const auto &rhs_a = _a;
|
const auto &rhs_a = _a;
|
||||||
const auto lhs_a_tag = lhs_a.tag();
|
const auto lhs_a_tag = lhs_a.tag();
|
||||||
const auto rhs_a_tag = rhs_a.tag();
|
const auto rhs_a_tag = rhs_a.tag();
|
||||||
if (lhs_a_tag != rhs_a_tag)
|
if (lhs_a_tag != rhs_a_tag)
|
||||||
return static_cast<int>(lhs_a_tag > rhs_a_tag) - static_cast<int>(lhs_a_tag < rhs_a_tag);
|
return static_cast<int>(lhs_a_tag > rhs_a_tag) - static_cast<int>(lhs_a_tag < rhs_a_tag);
|
||||||
const auto rhs_a_color = rhs_a.color();
|
const auto rhs_a_color = rhs_a.color();
|
||||||
const auto color_compare_result = lhs_a.KeyCompareWithValue(rhs_a_color);
|
const auto color_compare_result = lhs_a.KeyCompareWithValue(rhs_a_color);
|
||||||
@@ -506,8 +506,8 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Grain FLATBUFFERS_FINAL_CLASS {
|
|||||||
bool KeyCompareLessThan(const Grain * const o) const {
|
bool KeyCompareLessThan(const Grain * const o) const {
|
||||||
return KeyCompareWithValue(o->a()) < 0;
|
return KeyCompareWithValue(o->a()) < 0;
|
||||||
}
|
}
|
||||||
int KeyCompareWithValue(const ::flatbuffers::Array<keyfield::sample::Rice , 3> *_a) const {
|
int KeyCompareWithValue(const ::flatbuffers::Array<keyfield::sample::Rice, 3> *_a) const {
|
||||||
const ::flatbuffers::Array<keyfield::sample::Rice , 3> *curr_a = a();
|
const ::flatbuffers::Array<keyfield::sample::Rice, 3> *curr_a = a();
|
||||||
for (::flatbuffers::uoffset_t i = 0; i < curr_a->size(); i++) {
|
for (::flatbuffers::uoffset_t i = 0; i < curr_a->size(); i++) {
|
||||||
const auto &lhs_a = *(curr_a->Get(i));
|
const auto &lhs_a = *(curr_a->Get(i));
|
||||||
const auto &rhs_a = *(_a->Get(i));
|
const auto &rhs_a = *(_a->Get(i));
|
||||||
@@ -521,7 +521,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Grain FLATBUFFERS_FINAL_CLASS {
|
|||||||
}
|
}
|
||||||
const auto lhs_a_quantity = lhs_a.quantity();
|
const auto lhs_a_quantity = lhs_a.quantity();
|
||||||
const auto rhs_a_quantity = rhs_a.quantity();
|
const auto rhs_a_quantity = rhs_a.quantity();
|
||||||
if (lhs_a_quantity != rhs_a_quantity)
|
if (lhs_a_quantity != rhs_a_quantity)
|
||||||
return static_cast<int>(lhs_a_quantity > rhs_a_quantity) - static_cast<int>(lhs_a_quantity < rhs_a_quantity);
|
return static_cast<int>(lhs_a_quantity > rhs_a_quantity) - static_cast<int>(lhs_a_quantity < rhs_a_quantity);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user