[PATCH] Optimise trim_string() front-trimming
martin at meltin.net
Sun Jun 19 10:20:03 UTC 2016
On Fri, 26 Jun 2015 16:13:51 -0700, Herb Lewis <hlewis at panasas.com>
> We really should fix trim_string as well. The front trimming calls
> memmove for each character/string found instead of finding
> the first non-match and then calling memmove once.
Like this? Sometimes it is worth saving easy suggestions and
attacking them when fighting a cold... :-)
1. Add some tests for trim_string()
2. Optimise trim_string()'s front trimming to call memmove(3) just once
Please review and maybe push...
peace & happiness,
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 10201 bytes
Desc: not available
More information about the samba-technical