Yesterday I blogged about a bug I was having while implementing a serializer for my append only file storage. I blogged about it here.
The problem with the code is found by gaining a better understanding of how the += operator works:
x += y;
Is equivalent to writing
x = x + y;
The problem in this case can is explained in the following snippet:
The fixed version of the function can be seen here: