소스 검색

* 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;