Use FString::Back() when possible
Changed usages of str[str.Len() - 1] to str.Back()
This commit is contained in:
parent
d526ddf7ae
commit
cb982ec313
5 changed files with 7 additions and 7 deletions
|
|
@ -1720,7 +1720,7 @@ const char *BaseFileSearch (const char *file, const char *ext, bool lookfirstinp
|
|||
}
|
||||
if (lookfirstinprogdir)
|
||||
{
|
||||
mysnprintf (wad, countof(wad), "%s%s%s", progdir.GetChars(), progdir[progdir.Len() - 1] != '/' ? "/" : "", file);
|
||||
mysnprintf (wad, countof(wad), "%s%s%s", progdir.GetChars(), progdir.Back() == '/' ? "" : "/", file);
|
||||
if (DirEntryExists (wad))
|
||||
{
|
||||
return wad;
|
||||
|
|
@ -1747,7 +1747,7 @@ const char *BaseFileSearch (const char *file, const char *ext, bool lookfirstinp
|
|||
dir = NicePath(value);
|
||||
if (dir.IsNotEmpty())
|
||||
{
|
||||
mysnprintf (wad, countof(wad), "%s%s%s", dir.GetChars(), dir[dir.Len() - 1] != '/' ? "/" : "", file);
|
||||
mysnprintf (wad, countof(wad), "%s%s%s", dir.GetChars(), dir.Back() == '/' ? "" : "/", file);
|
||||
if (DirEntryExists (wad))
|
||||
{
|
||||
return wad;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue