2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-27 15:18:06 +00:00

dynamic-string: Optimize ds_put_char().

A qprof profile showed ds_put_char() and ds_put_uninit() as 4% of total
runtime.  This commit inlines the common case, which reduces them to 1%
total.
This commit is contained in:
Ben Pfaff
2010-05-03 12:30:37 -07:00
parent 836fad5e1a
commit 36c501fe78
2 changed files with 17 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ ds_put_uninit(struct ds *ds, size_t n)
}
void
ds_put_char(struct ds *ds, char c)
ds_put_char__(struct ds *ds, char c)
{
*ds_put_uninit(ds, 1) = c;
}