Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up extra white spaces #7800

Merged
merged 3 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/idl_gen_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2278,7 +2278,7 @@ class CppGenerator : public BaseGenerator {
code_ +=
space + "const auto {{RHS}} = {{RHS_PREFIX}}.{{CURR_FIELD_NAME}}();";
if (is_scalar) {
code_ += space + "if ({{LHS}} != {{RHS}})";
code_ += space + "if ({{LHS}} != {{RHS}})";
code_ += space +
" return static_cast<int>({{LHS}} > {{RHS}}) - "
"static_cast<int>({{LHS}} < {{RHS}});";
Expand Down Expand Up @@ -2343,7 +2343,7 @@ class CppGenerator : public BaseGenerator {
} else if (is_array) {
const auto &elem_type = field.value.type.VectorType();
std::string input_type = "::flatbuffers::Array<" +
GenTypeGet(elem_type, "", "", " ", false) +
GenTypeGet(elem_type, "", "", "", false) +
", " + NumToString(elem_type.fixed_length) + ">";
code_.SetValue("INPUT_TYPE", input_type);
code_ +=
Expand Down
10 changes: 5 additions & 5 deletions tests/key_field/key_field_sample_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Apple FLATBUFFERS_FINAL_CLASS {
return rgb_compare_result;
const auto lhs_color_tag = lhs_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 0;
}
Expand Down Expand Up @@ -381,7 +381,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Fruit FLATBUFFERS_FINAL_CLASS {
const auto &rhs_a = _a;
const auto lhs_a_tag = lhs_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);
const auto rhs_a_color = rhs_a.color();
const auto color_compare_result = lhs_a.KeyCompareWithValue(rhs_a_color);
Expand Down Expand Up @@ -506,8 +506,8 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Grain FLATBUFFERS_FINAL_CLASS {
bool KeyCompareLessThan(const Grain * const o) const {
return KeyCompareWithValue(o->a()) < 0;
}
int KeyCompareWithValue(const ::flatbuffers::Array<keyfield::sample::Rice , 3> *_a) const {
const ::flatbuffers::Array<keyfield::sample::Rice , 3> *curr_a = a();
int KeyCompareWithValue(const ::flatbuffers::Array<keyfield::sample::Rice, 3> *_a) const {
const ::flatbuffers::Array<keyfield::sample::Rice, 3> *curr_a = a();
for (::flatbuffers::uoffset_t i = 0; i < curr_a->size(); i++) {
const auto &lhs_a = *(curr_a->Get(i));
const auto &rhs_a = *(_a->Get(i));
Expand All @@ -521,7 +521,7 @@ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Grain FLATBUFFERS_FINAL_CLASS {
}
const auto lhs_a_quantity = lhs_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 0;
Expand Down