[Lazarus] LConvEncoding- why inline func?
Mattias Gaertner
nc-gaertnma at netcologne.de
Thu May 3 23:07:57 CEST 2018
On Thu, 3 May 2018 22:15:31 +0300
AlexeyT via Lazarus <lazarus at lists.lazarus-ide.org> wrote:
> procedure InternalUTF8ToCP(const s: string; TargetCodePage: TSystemCodePage;
> SetTargetCodePage: boolean;
> const UTF8CharConvFunc: TUnicodeToCharID;
> out TheResult: RawByteString); inline;
> begin
> if not Assigned(UTF8CharConvFunc) then
> begin
> TheResult:=s;
> SetCodePage(TheResult, TargetCodePage, True);
> if not SetTargetCodePage then
> SetCodePage(TheResult, CP_ACP, False);
> end else begin
> TheResult:=UTF8ToSingleByte(s,UTF8CharConvFunc);
> if SetTargetCodePage then
> SetCodePage(TheResult, TargetCodePage, False);
> end;
> end;
>
> Func is complex, why it's inline?
It is not supposed to be used directly. It is supposed to be used by a
few other functions, which are called a lot.
Mattias
More information about the Lazarus
mailing list