[Lazarus] Optimize SwapEndian for widestring?

Alexey aaa5500 at ya.ru
Tue Aug 1 15:32:06 CEST 2017


Pls tell can I optimize this func? E.g. calc each char's PWord and 
read/write word.


function SSwapEndian(const S: UnicodeString): UnicodeString;
var
   i: integer;
begin
   Result:= S;
   for i:= 1 to Length(Result) do
     Result[i]:= WideChar(SwapEndian(Ord(Result[i])));
end;

-- 
Regards,
Alexey



More information about the Lazarus mailing list