From 6da887c34fcbc55cfd0115cfe3ebcc3001bf0c4a Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 4 Apr 2015 17:47:36 -0500 Subject: [PATCH] Use Truncate to chop off extension in LumpNameSetup. - Left() always creates a new string. Truncate() can reuse the old one if it only has one reference. --- src/resourcefiles/resourcefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resourcefiles/resourcefile.cpp b/src/resourcefiles/resourcefile.cpp index bb3776e83..caeb1090f 100644 --- a/src/resourcefiles/resourcefile.cpp +++ b/src/resourcefiles/resourcefile.cpp @@ -94,7 +94,7 @@ void FResourceLump::LumpNameSetup(FString iname) { long slash = iname.LastIndexOf('/'); FString base = (slash >= 0) ? iname.Mid(slash + 1) : iname; - base = base.Left(base.LastIndexOf('.')); + base.Truncate(base.LastIndexOf('.')); uppercopy(Name, base); Name[8] = 0; FullName = iname;