Explorar o código

* 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 %!s(int64=12) %!d(string=hai) anos
pai
achega
e65d01a717
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      rtl/inc/ustrings.inc

+ 2 - 1
rtl/inc/ustrings.inc

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