瀏覽代碼

* 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 年之前
父節點
當前提交
e65d01a717
共有 1 個文件被更改,包括 2 次插入1 次删除
  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;