On Tue, 1 Aug 2017, Alexey via Lazarus wrote:
Pls tell can I optimize this func? E.g. calc each char's PWord and
read/write word.
Probably this will be faster:
function SSwapEndian(const S: UnicodeString): UnicodeString;
var
i: integer;
p :pwidechar;
begin
Result:= S;
UniqueString(Result);
P:=PWideChar(Result[1]));
for i:= 1 to Length(Result) do
begin
P^:= WideChar(SwapEndian(P^));
Inc(P);
end;
end;
--
_______________________________________________
Lazarus mailing list
[email protected]
https://lists.lazarus-ide.org/listinfo/lazarus