瀏覽代碼

* Small optimizations in FindOptionIndex by lagprogramming. Fixes issue #40663

Michaël Van Canneyt 1 年之前
父節點
當前提交
1bb452d1c7
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      packages/fcl-base/src/custapp.pp

+ 2 - 2
packages/fcl-base/src/custapp.pp

@@ -512,13 +512,13 @@ begin
     If (Length(O)>1) and (O[1]=FOptionChar) then
     If (Length(O)>1) and (O[1]=FOptionChar) then
       begin
       begin
       Delete(O,1,1);
       Delete(O,1,1);
-      LongOpt:=(Length(O)>0) and (O[1]=FOptionChar);
+      LongOpt:=(O[1]=FOptionChar);
       If LongOpt then
       If LongOpt then
         begin
         begin
         Delete(O,1,1);
         Delete(O,1,1);
         P:=Pos('=',O);
         P:=Pos('=',O);
         If (P<>0) then
         If (P<>0) then
-          O:=Copy(O,1,P-1);
+          SetLength(O,P-1);
         end;
         end;
       If Not CaseSensitiveOptions then
       If Not CaseSensitiveOptions then
         O:=UpperCase(O);
         O:=UpperCase(O);