inlined some short chunk functions, showed up in the profiler
This commit is contained in:
@@ -42,15 +42,6 @@
|
||||
*/
|
||||
chunk_t chunk_empty = { NULL, 0 };
|
||||
|
||||
/**
|
||||
* Described in header.
|
||||
*/
|
||||
chunk_t chunk_create(u_char *ptr, size_t len)
|
||||
{
|
||||
chunk_t chunk = {ptr, len};
|
||||
return chunk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Described in header.
|
||||
*/
|
||||
@@ -436,39 +427,6 @@ chunk_t chunk_from_base64(chunk_t base64, char *buf)
|
||||
return chunk_create(buf, outlen);
|
||||
}
|
||||
|
||||
/**
|
||||
* Described in header.
|
||||
*/
|
||||
void chunk_free(chunk_t *chunk)
|
||||
{
|
||||
free(chunk->ptr);
|
||||
chunk->ptr = NULL;
|
||||
chunk->len = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Described in header.
|
||||
*/
|
||||
void chunk_clear(chunk_t *chunk)
|
||||
{
|
||||
memset(chunk->ptr, 0, chunk->len);
|
||||
chunk_free(chunk);
|
||||
}
|
||||
|
||||
/**
|
||||
* Described in header.
|
||||
*/
|
||||
chunk_t chunk_skip(chunk_t chunk, size_t bytes)
|
||||
{
|
||||
if (chunk.len > bytes)
|
||||
{
|
||||
chunk.ptr += bytes;
|
||||
chunk.len -= bytes;
|
||||
return chunk;
|
||||
}
|
||||
return chunk_empty;
|
||||
}
|
||||
|
||||
/**
|
||||
* Described in header.
|
||||
*/
|
||||
@@ -484,15 +442,6 @@ int chunk_compare(chunk_t a, chunk_t b)
|
||||
return memcmp(a.ptr, b.ptr, len);
|
||||
};
|
||||
|
||||
/**
|
||||
* Described in header.
|
||||
*/
|
||||
bool chunk_equals(chunk_t a, chunk_t b)
|
||||
{
|
||||
return a.ptr != NULL && b.ptr != NULL &&
|
||||
a.len == b.len && memeq(a.ptr, b.ptr, a.len);
|
||||
}
|
||||
|
||||
/**
|
||||
* Described in header.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user