#1 2022-06-16 11:43:23

tbo
Member
Registered: 2015-04-20
Posts: 353

function DynArrayCopy()

Unit mormot.core.rtti

Function DynArrayCopy() is defined as follows:

procedure DynArrayCopy(Dest, Source: PPointer; Info: PRttiInfo; SourceExtCount: PInteger);

Why not define it this way?

procedure DynArrayCopy(Dest, Source: PPointer; Info: PRttiInfo; SourceExtCount: PInteger = Nil);

I only noticed after viewing the source that it could also be Nil.

With best regards
Thomas

Last edited by tbo (2022-06-16 11:56:18)

Offline

#2 2022-06-16 16:52:47

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,657
Website

Re: function DynArrayCopy()

This is a very low-level function. The idea is to rather use TDynArray, or just the standard copy() function, which does not require a TypeInfo() parameter.

Please see https://github.com/synopse/mORMot2/commit/afd9bbb0

Online

Board footer

Powered by FluxBB