mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +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:
@@ -50,9 +50,10 @@ inline std::string VideoProperty::GetString() const {
|
||||
return GetStringProperty(m_handle, &m_status);
|
||||
}
|
||||
|
||||
inline void VideoProperty::GetString(llvm::SmallVectorImpl<char>& value) const {
|
||||
inline llvm::StringRef VideoProperty::GetString(
|
||||
llvm::SmallVectorImpl<char>& buf) const {
|
||||
m_status = 0;
|
||||
GetStringProperty(m_handle, value, &m_status);
|
||||
return GetStringProperty(m_handle, buf, &m_status);
|
||||
}
|
||||
|
||||
inline void VideoProperty::SetString(llvm::StringRef value) {
|
||||
|
||||
Reference in New Issue
Block a user