[PATCH] Fixing dive notes escape characters in World map exporter

Gehad gehadelrobey at gmail.com
Tue Apr 1 04:13:06 PDT 2014


On 04/01/2014 06:50 AM, Dirk Hohndel wrote:
> b) I know that different people have different preferences there, but
> from an API perspective I would prefer replace_char(string, old, new)
I changed the order of the arguments, I am not sure if you me to change 
the names too.
> c) I'm not in love with the realloc inside the loop. I realize that the
> code is correct and that this maybe isn't the most performance critical
> part of our application, but still... you could either brute force it
> (worst case assumption of len(string)/len(old)*len(new) or you could
> count the occurrences of old and then calculate the correct size of the
> allocation
I don't usually use realloc() but I found it used a lot in the membuffer 
functions, I changed it to one memory allocation in the start after 
calculating the new size.
I tried to follow the coding style in this patch.

-- 
Regards,
Gehad Elrobey

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Fixing-dive-notes-escape-characters-in-worldmap-expo.patch
Type: text/x-patch
Size: 2003 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140401/b1c193b7/attachment.bin>


More information about the subsurface mailing list