mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 08:11:29 +01:00 
			
		
		
		
	* RTL, Pos() with Variant: added 'const' modifiers to avoid unnecessary local copies of managed parameters.
git-svn-id: trunk@25479 -
This commit is contained in:
		
							parent
							
								
									b99cf8d680
								
							
						
					
					
						commit
						cf20bbc886
					
				| @ -1102,59 +1102,59 @@ Function Pos (s : ShortString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE | |||||||
|   end; |   end; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Function Pos (a : AnsiString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const a : AnsiString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
|   begin |   begin | ||||||
|     Result:=Pos(a,AnsiString(v)); |     Result:=Pos(a,AnsiString(v)); | ||||||
|   end; |   end; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Function Pos (w : WideString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const w : WideString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
|   begin |   begin | ||||||
|     Result:=Pos(w,WideString(v)); |     Result:=Pos(w,WideString(v)); | ||||||
|   end; |   end; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| {$ifndef FPC_WIDESTRING_EQUAL_UNICODESTRING} | {$ifndef FPC_WIDESTRING_EQUAL_UNICODESTRING} | ||||||
| Function Pos (w : UnicodeString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const w : UnicodeString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
|   begin |   begin | ||||||
|     Result:=Pos(w,UnicodeString(v)); |     Result:=Pos(w,UnicodeString(v)); | ||||||
|   end; |   end; | ||||||
| {$endif FPC_WIDESTRING_EQUAL_UNICODESTRING} | {$endif FPC_WIDESTRING_EQUAL_UNICODESTRING} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Function Pos (v : Variant; Const c : Char) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const v : Variant; Const c : Char) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
|   begin |   begin | ||||||
|     Result:=Pos(ShortString(v),c); |     Result:=Pos(ShortString(v),c); | ||||||
|   end; |   end; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Function Pos (v : Variant; Const s : ShortString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const v : Variant; Const s : ShortString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
|   begin |   begin | ||||||
|     Result:=Pos(ShortString(v),s); |     Result:=Pos(ShortString(v),s); | ||||||
|   end; |   end; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Function Pos (v : Variant; Const a : AnsiString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const v : Variant; Const a : AnsiString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
|   begin |   begin | ||||||
|     Result:=Pos(AnsiString(v),a); |     Result:=Pos(AnsiString(v),a); | ||||||
|   end; |   end; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Function Pos (v : Variant; Const w : WideString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const v : Variant; Const w : WideString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
|   begin |   begin | ||||||
|     Result:=Pos(WideString(v),w); |     Result:=Pos(WideString(v),w); | ||||||
|   end; |   end; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| {$ifndef FPC_WIDESTRING_EQUAL_UNICODESTRING} | {$ifndef FPC_WIDESTRING_EQUAL_UNICODESTRING} | ||||||
| Function Pos (v : Variant; Const w : UnicodeString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const v : Variant; Const w : UnicodeString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
|   begin |   begin | ||||||
|     Result:=Pos(UnicodeString(v),w); |     Result:=Pos(UnicodeString(v),w); | ||||||
|   end; |   end; | ||||||
| {$endif FPC_WIDESTRING_EQUAL_UNICODESTRING} | {$endif FPC_WIDESTRING_EQUAL_UNICODESTRING} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Function Pos (v1 : Variant; Const v2 : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const v1 : Variant; Const v2 : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
|   begin |   begin | ||||||
|     Result:=Pos(WideString(v1),WideString(v2)); |     Result:=Pos(WideString(v1),WideString(v2)); | ||||||
|   end; |   end; | ||||||
|  | |||||||
| @ -495,19 +495,19 @@ operator :=(const source : terror) dest : olevariant;{$ifdef SYSTEMINLINE}inline | |||||||
| { silly, but how else should the compiler know what to do with pos(<string type>,<variant>)? (FK) } | { silly, but how else should the compiler know what to do with pos(<string type>,<variant>)? (FK) } | ||||||
| Function Pos (c : Char; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (c : Char; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
| Function Pos (s : ShortString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (s : ShortString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
| Function Pos (a : AnsiString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const a : AnsiString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
| Function Pos (w : WideString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const w : WideString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
| {$ifndef FPC_WIDESTRING_EQUAL_UNICODESTRING} | {$ifndef FPC_WIDESTRING_EQUAL_UNICODESTRING} | ||||||
| Function Pos (w : UnicodeString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const w : UnicodeString; Const v : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
| {$endif FPC_WIDESTRING_EQUAL_UNICODESTRING} | {$endif FPC_WIDESTRING_EQUAL_UNICODESTRING} | ||||||
| Function Pos (v : Variant; Const c : Char) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const v : Variant; Const c : Char) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
| Function Pos (v : Variant; Const s : ShortString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const v : Variant; Const s : ShortString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
| Function Pos (v : Variant; Const a : AnsiString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const v : Variant; Const a : AnsiString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
| Function Pos (v : Variant; Const w : WideString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const v : Variant; Const w : WideString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
| {$ifndef FPC_WIDESTRING_EQUAL_UNICODESTRING} | {$ifndef FPC_WIDESTRING_EQUAL_UNICODESTRING} | ||||||
| Function Pos (v : Variant; Const w : UnicodeString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const v : Variant; Const w : UnicodeString) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
| {$endif FPC_WIDESTRING_EQUAL_UNICODESTRING} | {$endif FPC_WIDESTRING_EQUAL_UNICODESTRING} | ||||||
| Function Pos (v1 : Variant; Const v2 : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | Function Pos (const v1 : Variant; Const v2 : Variant) : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif} | ||||||
| 
 | 
 | ||||||
| {********************************************************************** | {********************************************************************** | ||||||
|                              OLEVariant Operators |                              OLEVariant Operators | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 sergei
						sergei