inlined some short chunk functions, showed up in the profiler

This commit is contained in:
Martin Willi
2008-11-26 10:08:36 +00:00
parent 4fd233a73e
commit e2cb07d713
2 changed files with 30 additions and 56 deletions
-51
View File
@@ -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.
*