Browse Source

* fixed Pos(WideChar,AnsiString)

git-svn-id: trunk@10973 -
Jonas Maebe 17 years ago
parent
commit
fe202fd232
1 changed files with 3 additions and 16 deletions
  1. 3 16
      rtl/inc/wustrings.inc

+ 3 - 16
rtl/inc/wustrings.inc

@@ -1312,22 +1312,9 @@ end;
 
 
 
 
 Function Pos (c : WideChar; Const s : AnsiString) : SizeInt;
 Function Pos (c : WideChar; Const s : AnsiString) : SizeInt;
-var
-  i: SizeInt;
-  pc : pchar;
-begin
-  pc:=@s[1];
-  for i:=1 to length(s) do
-   begin
-     if widechar(pc^)=c then
-      begin
-        pos:=i;
-        exit;
-      end;
-     inc(pc);
-   end;
-  pos:=0;
-end;
+  begin
+    result:=Pos(c,WideString(s));
+  end;
 
 
 
 
 Function Pos (c : AnsiString; Const s : WideString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif}
 Function Pos (c : AnsiString; Const s : WideString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif}