Skip to content
Snippets Groups Projects
Verified Commit 5f3bd722 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

STY: Clang formatting

parent 34dabbb6
Branches
Tags
2 merge requests!61Release 0.3.0,!50ENH: Values can hold empty vector
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
this->wrapped->mutable_list_values()->add_values()->SETTER(value); \ this->wrapped->mutable_list_values()->add_values()->SETTER(value); \
} \ } \
if (values.empty()) { \ if (values.empty()) { \
this->wrapped->mutable_list_values()->add_values()->set_special_value \ this->wrapped->mutable_list_values()->add_values()->set_special_value( \
(ProtoSpecialValue::SPECIAL_VALUE_UNSPECIFIED); \ ProtoSpecialValue::SPECIAL_VALUE_UNSPECIFIED); \
} \ } \
} }
...@@ -389,9 +389,9 @@ public: ...@@ -389,9 +389,9 @@ public:
return !IsNull() && this->wrapped->value_case() == ValueCase::kListValues; return !IsNull() && this->wrapped->value_case() == ValueCase::kListValues;
} }
[[nodiscard]] inline auto GetAsVector() const noexcept -> const std::vector<ScalarValue> & { [[nodiscard]] inline auto GetAsVector() const noexcept -> const std::vector<ScalarValue> & {
if (!IsVector() || (this->wrapped->list_values().values(0).has_special_value() if (!IsVector() || (this->wrapped->list_values().values(0).has_special_value() &&
&& this->wrapped->list_values().values(0).special_value() this->wrapped->list_values().values(0).special_value() ==
== ProtoSpecialValue::SPECIAL_VALUE_UNSPECIFIED)) { ProtoSpecialValue::SPECIAL_VALUE_UNSPECIFIED)) {
// create empty list // create empty list
static std::vector<ScalarValue> empty_values; static std::vector<ScalarValue> empty_values;
return empty_values; return empty_values;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment