mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Remove CStr::Left
It was only a wrapper around `std::string::substr`. In some places it's better to use `std::string::starts_with`.
This commit is contained in:
@@ -288,7 +288,7 @@ void WriteJSONFile(const Script::Interface& scriptInterface, const std::wstring&
|
||||
bool DeleteCampaignSave(const CStrW& filePath)
|
||||
{
|
||||
OsPath realPath;
|
||||
if (filePath.Left(16) != L"saves/campaigns/" || filePath.Right(12) != L".0adcampaign")
|
||||
if (!filePath.starts_with(L"saves/campaigns/") || filePath.Right(12) != L".0adcampaign")
|
||||
return false;
|
||||
if (!VfsFileExists(filePath))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user