Bladeren bron

* small optimisation for ToSingleByteFileSystemEncodedFileName(rawbytestring):
don't call SetCodePage() if the input already has the correct code page
(SetCodePage would always make the string unique, which is not necessary)

git-svn-id: branches/cpstrrtl@24962 -

Jonas Maebe 12 jaren geleden
bovenliggende
commit
e65d01a717
1 gewijzigde bestanden met toevoegingen van 2 en 1 verwijderingen
  1. 2 1
      rtl/inc/ustrings.inc

+ 2 - 1
rtl/inc/ustrings.inc

@@ -2296,5 +2296,6 @@ End;
 Function ToSingleByteFileSystemEncodedFileName(const Str: RawByteString): RawByteString;
 Begin
   Result:=Str;
-  SetCodePage(Result,DefaultFileSystemCodePage,True);
+  if StringCodePage(Result)<>DefaultFileSystemCodePage then
+    SetCodePage(Result,DefaultFileSystemCodePage,True);
 End;