mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpiutil] StringExtras: Add substr() (#3742)
Unlike std::string and std::string_view, this substr() allows a start greater than the length of the string, in which case an empty string is returned. This matches llvm::StringRef behavior.
This commit is contained in:
@@ -269,7 +269,7 @@ void UsbCameraImpl::DeviceDisconnect() {
|
||||
|
||||
static bool IsPercentageProperty(std::string_view name) {
|
||||
if (wpi::starts_with(name, "raw_"))
|
||||
name = name.substr(4);
|
||||
name = wpi::substr(name, 4);
|
||||
return name == "Brightness" || name == "Contrast" || name == "Saturation" ||
|
||||
name == "Hue" || name == "Sharpness" || name == "Gain" ||
|
||||
name == "Exposure";
|
||||
|
||||
Reference in New Issue
Block a user