[Lazarus] LConvEncoding- why inline func?

AlexeyT aaa5500 at ya.ru
Thu May 3 21:15:31 CEST 2018


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?

-- 
Regards,
Alexey



More information about the Lazarus mailing list