From d4fc339810189a5c4646e83856d4f98d83345499 Mon Sep 17 00:00:00 2001 From: Xavi Del Campo Date: Sat, 21 Mar 2020 20:11:06 +0100 Subject: [PATCH] Added comments to dynstr_dup() --- include/dynstr.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/dynstr.h b/include/dynstr.h index a545b81..d685985 100644 --- a/include/dynstr.h +++ b/include/dynstr.h @@ -108,6 +108,13 @@ enum dynstr_err dynstr_append(struct dynstr *d, const char *format, ...); * # DYNSTR_ERR_ALLOC if no more memory is available. * # DYNSTR_ERR_INIT if destination dynamic string was not initialized. * # DYNSTR_ERR_SRC if source dynamic string has no length or data. + * @note This function has the same effect as calling: + * @code + * dynstr_append(&dst, "%s", src.str); + * @endcode + * However, the implementation for dynstr_dup() should be faster as it + * does not rely on vsnprintf(), as opposed to dynstr_append(). If in + * doubt, always profile your code. */ enum dynstr_err dynstr_dup(struct dynstr *dst, const struct dynstr *src);