Make Tuple::pack return a Standalone<StringRef> (#7764)

This makes it less error-prone and more like other similar functions
like BinaryWriter::toValue

Closes #7748
This commit is contained in:
Andrew Noyes 2022-08-02 12:45:56 -07:00 committed by GitHub
parent 48e46cbc81
commit 5dbb6f1dd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -63,7 +63,9 @@ struct Tuple {
Tuple& appendNull();
Tuple& appendVersionstamp(Versionstamp const&);
StringRef pack() const { return StringRef(data.begin(), data.size()); }
Standalone<StringRef> pack() const {
return Standalone<StringRef>(StringRef(data.begin(), data.size()), data.arena());
}
template <typename T>
Tuple& operator<<(T const& t) {

View File

@ -56,7 +56,9 @@ struct Tuple {
Tuple& appendNull();
Tuple& append(Versionstamp const&);
StringRef pack() const { return StringRef(data.begin(), data.size()); }
Standalone<StringRef> pack() const {
return Standalone<StringRef>(StringRef(data.begin(), data.size()), data.arena());
}
template <typename T>
Tuple& operator<<(T const& t) {