perf: 删除无效代码;修改变量命名;减少内存分配
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user