]>
git.proxmox.com Git - libgit2.git/blob - src/oidarray.c
2 * Copyright (C) the libgit2 contributors. All rights reserved.
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
10 #include "git2/oidarray.h"
13 void git_oidarray_dispose(git_oidarray
*arr
)
18 void git_oidarray__from_array(git_oidarray
*arr
, git_array_oid_t
*array
)
20 arr
->count
= array
->size
;
21 arr
->ids
= array
->ptr
;
24 void git_oidarray__reverse(git_oidarray
*arr
)
29 for (i
= 0; i
< arr
->count
/ 2; i
++) {
30 git_oid_cpy(&tmp
, &arr
->ids
[i
]);
31 git_oid_cpy(&arr
->ids
[i
], &arr
->ids
[(arr
->count
-1)-i
]);
32 git_oid_cpy(&arr
->ids
[(arr
->count
-1)-i
], &tmp
);
36 #ifndef GIT_DEPRECATE_HARD
38 void git_oidarray_free(git_oidarray
*arr
)
40 git_oidarray_dispose(arr
);