Closed mchestnut163 closed 3 weeks ago
Hi,
It is like this by design.
Add()
method does not check for previous items with the same key in TList
internal data structure.
S[]
and other shortners do check for previous items.
In conclusion, if you are sure your data do not have key duplication, use Add()
. If you are not so sure, you can use a combination of HasKey()
and Add()
or use S[]
shortners.
Thanks for the reminder.
Done.
1.Obj.S['foo'] := 'bar'; 2.Obj.add('foo').asstring= 'bar'; The efficiency difference between the above two operation methods is huge