File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1758,14 +1758,6 @@ Value Value::WrapMapFieldValue(
17581758 }
17591759}
17601760
1761- absl::optional<BoolValue> Value::AsBool () const {
1762- if (const auto * alternative = variant_.As <BoolValue>();
1763- alternative != nullptr ) {
1764- return *alternative;
1765- }
1766- return absl::nullopt ;
1767- }
1768-
17691761optional_ref<const BytesValue> Value::AsBytes () const & {
17701762 if (const auto * alternative = variant_.As <BytesValue>();
17711763 alternative != nullptr ) {
@@ -2178,11 +2170,6 @@ absl::optional<UnknownValue> Value::AsUnknown() && {
21782170 return absl::nullopt ;
21792171}
21802172
2181- BoolValue Value::GetBool () const {
2182- ABSL_DCHECK (IsBool ()) << *this ;
2183- return variant_.Get <BoolValue>();
2184- }
2185-
21862173const BytesValue& Value::GetBytes () const & {
21872174 ABSL_DCHECK (IsBytes ()) << *this ;
21882175 return variant_.Get <BytesValue>();
Original file line number Diff line number Diff line change @@ -722,7 +722,13 @@ class Value final : private common_internal::ValueMixin<Value> {
722722 // Performs a checked cast from a value to a bool value,
723723 // returning a non-empty optional with either a value or reference to the
724724 // bool value. Otherwise an empty optional is returned.
725- absl::optional<BoolValue> AsBool () const ;
725+ absl::optional<BoolValue> AsBool () const {
726+ if (const auto * alternative = variant_.As <BoolValue>();
727+ alternative != nullptr ) {
728+ return *alternative;
729+ }
730+ return absl::nullopt ;
731+ }
726732
727733 // Performs a checked cast from a value to a bytes value,
728734 // returning a non-empty optional with either a value or reference to the
@@ -1661,7 +1667,10 @@ class Value final : private common_internal::ValueMixin<Value> {
16611667 // Performs an unchecked cast from a value to a bool value. In
16621668 // debug builds a best effort is made to crash. If `IsBool()` would return
16631669 // false, calling this method is undefined behavior.
1664- BoolValue GetBool () const ;
1670+ BoolValue GetBool () const {
1671+ ABSL_DCHECK (IsBool ()) << *this ;
1672+ return variant_.Get <BoolValue>();
1673+ }
16651674
16661675 // Performs an unchecked cast from a value to a bytes value. In
16671676 // debug builds a best effort is made to crash. If `IsBytes()` would return
You can’t perform that action at this time.
0 commit comments