Browse Source

* 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 năm trước cách đây
mục cha
commit
e65d01a717
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  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;