[PATCH 1/4] msvcp90: Added basic_string<char>::swap implementation. (try 2)

Piotr Caban piotr.caban at gmail.com
Mon Nov 15 16:28:22 CST 2010

On 11/15/10 18:26, Vincas Miliūnas wrote:
> The way I see this is that the code above handles the case when lhs string is in the local buffer and rhs is allocated. The exchange requires copying (lhs->data->buf into rhs->data->buf and rhs->data->ptr into lhs->data->ptr), since setting one's ptr to other's buf would be illegal. Also, the ptr and buf are in an union construct and overlap, therefore only one can be stored at a time.
You can copy whole union without knowing what field is used. This way 
you can implement it with only one else statement.

+    if (this == str)
+    {
Please try to follow coding style used in modified file (no space after 
if, new block bracket in the same line).

More information about the wine-devel mailing list