On Fri, Apr 18, 2025 at 10:46:42AM -0400, Leo Izen wrote: > On 4/17/25 16:12, Michael Niedermayer wrote: > > > > > > > + * @param keyvalue_cmp compare function, will be passed the key + > > > > value concatenated. > > > > > > Please no. Pass the key and the value separately to the compare > > > function. > > > > thats neither efficient nor does it fit the existing APIs. > > The value is most of the time not used and when used it is known exactly > > where it is. after a string compare of the key thats equal the value > > location is known > > or with arbitrary binary data the compare function knows the size of the > > data. > > Passing redudant pointers just wastes cpu cycles > > also existing APIs from av_tree strcmp() av_strcasecmp() and so on none of > > which take 4 pointers from which they would ignore 2. > > > The problem is that passing the key and value pairs combined requires you to > concatenate them. Since AVMapEntry has two separate pointers *key and > *value, it doesn't make sense to concatenate them before comparison > rather than just pass the pointers as-is.
AVMapEntry.key and value are always concatenate already thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Nations do behave wisely once they have exhausted all other alternatives. -- Abba Eban
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".