mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-22 19:19:41 +00:00
tree: make path len uint16_t and avoid holes
This reduces the size of the struct from 32 to 26 bytes, and leaves a single padding byte at the end of the struct (which comes from the zero-length array).
This commit is contained in:
parent
2580077fc2
commit
ee42bb0e3d
@ -125,7 +125,7 @@ static git_tree_entry *alloc_entry(const char *filename)
|
||||
|
||||
struct tree_key_search {
|
||||
const char *filename;
|
||||
size_t filename_len;
|
||||
uint16_t filename_len;
|
||||
};
|
||||
|
||||
static int homing_search_cmp(const void *key, const void *array_member)
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
struct git_tree_entry {
|
||||
uint16_t attr;
|
||||
uint16_t filename_len;
|
||||
git_oid oid;
|
||||
bool pooled;
|
||||
size_t filename_len;
|
||||
char filename[GIT_FLEX_ARRAY];
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user