[Patch] LCLProc.GetPart has unnecessary overloads
Original Reporter info from Mantis: etrusco
-
Reporter name: Flávio Etrusco
Original Reporter info from Mantis: etrusco
- Reporter name: Flávio Etrusco
Description:
LCLProc.GetPart has unnecessary overloads and yet doesn't have a version that takes strings and avoid changing ASource...
Additional information:
=== (+10,-24) lcl/lclproc.pas === @@ -264,11 +264,10 @@ // some string manipulation functions function StripLN(const ALine: String): String; -function GetPart(const ASkipTo, AnEnd: String; var ASource: String): String; overload; -function GetPart(const ASkipTo, AnEnd: String; var ASource: String; const AnIgnoreCase: Boolean): String; overload; -function GetPart(const ASkipTo, AnEnd: array of String; var ASource: String): String; overload; -function GetPart(const ASkipTo, AnEnd: array of String; var ASource: String; const AnIgnoreCase: Boolean): String; overload; -function GetPart(const ASkipTo, AnEnd: array of String; var ASource: String; const AnIgnoreCase, AnUpdateSource: Boolean): String; overload; +function GetPart(const ASkipTo, AnEnd: String; var ASource: String; + const AnIgnoreCase: Boolean = False; const AnUpdateSource: Boolean = True): String; +function GetPart(const ASkipTo, AnEnd: array of String; var ASource: String; + const AnIgnoreCase: Boolean = False; const AnUpdateSource: Boolean = True): String; function TextToSingleLine(const AText: string): string; // case..of utility functions @@ -2862,27 +2861,14 @@ Result := Copy(ALine, 1, idx - 1); end; -function GetPart(const ASkipTo, AnEnd: String; var ASource: String): String; +function GetPart(const ASkipTo, AnEnd: String; var ASource: String; + const AnIgnoreCase, AnUpdateSource: Boolean): String; begin - Result := GetPart([ASkipTo], [AnEnd], ASource, False, True); + Result := GetPart([ASkipTo], [AnEnd], ASource, AnIgnoreCase, AnUpdateSource); end; -function GetPart(const ASkipTo, AnEnd: String; var ASource: String; const AnIgnoreCase: Boolean): String; overload; -begin - Result := GetPart([ASkipTo], [AnEnd], ASource, AnIgnoreCase, True); -end; - -function GetPart(const ASkipTo, AnEnd: array of String; var ASource: String): String; overload; -begin - Result := GetPart(ASkipTo, AnEnd, ASource, False, True); -end; - -function GetPart(const ASkipTo, AnEnd: array of String; var ASource: String; const AnIgnoreCase: Boolean): String; overload; -begin - Result := GetPart(ASkipTo, AnEnd, ASource, AnIgnoreCase, True); -end; - -function GetPart(const ASkipTo, AnEnd: array of String; var ASource: String; const AnIgnoreCase, AnUpdateSource: Boolean): String; overload; +function GetPart(const ASkipTo, AnEnd: array of String; var ASource: String; + const AnIgnoreCase: Boolean = False; const AnUpdateSource: Boolean = True): String; var n, i, idx: Integer; S, Source, Match: String;
Mantis conversion info:
- Mantis ID: 16175
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.29 (SVN)
- Fixed in revision: 25156 (#8509dda5)
- Target version: 0.9.30