mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Use StringRef and ArrayRef return values when buf passed.
For functions where a SmallVector is passed to be used as a stack buffer for the return value, have the return value be the appropriate StringRef or ArrayRef type. This allows for both more natural usage and enables directly returning (rather than copying) a permanently stored or constant string.
This commit is contained in:
@@ -258,9 +258,9 @@ HTTPSinkImpl::HTTPSinkImpl(llvm::StringRef name, llvm::StringRef description,
|
||||
|
||||
HTTPSinkImpl::~HTTPSinkImpl() { Stop(); }
|
||||
|
||||
void HTTPSinkImpl::GetDescription(llvm::SmallVectorImpl<char>& desc) const {
|
||||
llvm::raw_svector_ostream oss{desc};
|
||||
oss << m_description;
|
||||
llvm::StringRef HTTPSinkImpl::GetDescription(
|
||||
llvm::SmallVectorImpl<char>& buf) const {
|
||||
return m_description;
|
||||
}
|
||||
|
||||
void HTTPSinkImpl::Stop() {
|
||||
|
||||
Reference in New Issue
Block a user