perf: 删除无效代码;修改变量命名;减少内存分配

This commit is contained in:
luwenpeng
2023-11-23 16:52:06 +08:00
parent cbac7fea29
commit bda50d79af
19 changed files with 2937 additions and 472 deletions

View File

@@ -102,17 +102,6 @@ int mutable_array_index_elem(struct mutable_array *array, int index)
* sids
******************************************************************************/
void sids_write_once(struct sids *dst, struct sids *src)
{
if (dst && src)
{
if (dst->num == 0 && src->num > 0)
{
sids_copy(dst, src);
}
}
}
void sids_copy(struct sids *dst, struct sids *src)
{
if (dst && src)
@@ -126,17 +115,6 @@ void sids_copy(struct sids *dst, struct sids *src)
* route_ctx
******************************************************************************/
void route_ctx_write_once(struct route_ctx *dst, struct route_ctx *src)
{
if (dst && src)
{
if (dst->len == 0)
{
route_ctx_copy(dst, src);
}
}
}
void route_ctx_copy(struct route_ctx *dst, struct route_ctx *src)
{
memcpy(dst->data, src->data, src->len);