Commit b59913e4 by Abseil Team Committed by Copybara-Service

Add ABSL_ATTRIBUTE_LIFETIME_BOUND to Cord::Flatten/TryFlat

These were already on the declarations, but it seems like the definitions need them as well.

PiperOrigin-RevId: 621868985
Change-Id: I2595aae506924f8b1dad3b07efe1660ae0e4488e
parent 377de9d7
......@@ -1354,7 +1354,8 @@ inline size_t Cord::EstimatedMemoryUsage(
return result;
}
inline absl::optional<absl::string_view> Cord::TryFlat() const {
inline absl::optional<absl::string_view> Cord::TryFlat() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
absl::cord_internal::CordRep* rep = contents_.tree();
if (rep == nullptr) {
return absl::string_view(contents_.data(), contents_.size());
......@@ -1366,7 +1367,7 @@ inline absl::optional<absl::string_view> Cord::TryFlat() const {
return absl::nullopt;
}
inline absl::string_view Cord::Flatten() {
inline absl::string_view Cord::Flatten() ABSL_ATTRIBUTE_LIFETIME_BOUND {
absl::cord_internal::CordRep* rep = contents_.tree();
if (rep == nullptr) {
return absl::string_view(contents_.data(), contents_.size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment