xbmc/xbmc — pull request #1054 by jmarshallnz (2012-06-08 04:19:05+00:00)
Title: switch CVariant back to using a single data member

This essentially reverts bfd5673a698d2f80f6d32e3b5efdf47737d3260f whilst fixing the issue that that brought up (memleak on the assignment operator).

It brings CVariant back to 2 members or 12 bytes, rather than the previous 100-odd bytes which was only going to increase further with the addition of a wstring datatype. CVariants (and vectors or maps of them) are becoming more widely used - they'll be used for all sorting for example soon, and a vector of 1000 CVariants would be over 100k just in overheads at present.

There is very likely more room for optimisation should it be found necessary. For example, the copy constructor need not call the full operator=() (the assignment portion could be split out to a separate function for instance).

@topfs2 and @Montellese review especially appreciated. Other comments welcome as usual.