Talk:LlLinksetDataListKeys

From Second Life Wiki
Revision as of 13:47, 11 December 2022 by Gwyneth Llewelyn (talk | contribs) (→‎In which order are the key/value pairs stored?: new section)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In which order are the key/value pairs stored?

Usually, KVP implementations, even those allowing some form of key transversal, never guarantee a specific 'order', just that all keys will be retrieved; two successive runs of the key transversal may or may not return the same keys in the same order, merely because there might have been automatic garbage collection or other optimisation techniques running in the background which might have reordered the keys.

These LSL functions, however, seem to presume that the KVP store has an implicit order — or else, speaking of the 'first' element in the store would not make sense. It would be just 'a' element, not 'the first'.

This is just important for those applications which might just retrieve a batch at a time (or even just one KVP!) for processing — and will need to know if they can rely on these LSL function calls to guarantee that with each successive llLinksetDataListKeys call, a different key will be retrieved, possibly in the same order, until the 'last' key is retrieved. This implies that abstract concepts such as 'first', 'next', 'previous', 'first' and 'last' element in the KVP store are not arbitrary, but that subsequently, such calls will correctly retrieve all the key/value pairs in the order they are internally stored.

I haven't toyed & tinkered enough to answer myself, so I'm wondering if anyone has made some more testing on this specific issue...

Gwyneth Llewelyn (talk) 13:47, 11 December 2022 (PST)