mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 01:42:37 +08:00
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:
parent
48e46cbc81
commit
5dbb6f1dd3
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user