summaryrefslogtreecommitdiff
path: root/src/vector.h
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-05-02 15:59:02 -0700
committerVicent Martí <tanoku@gmail.com>2012-05-02 15:59:02 -0700
commit40879facad0337d954d4904e212af3b36cdb9465 (patch)
treeaea730551948c67bb1fb88098cf8a67d3ed3211d /src/vector.h
parent2218fd57a50ceb851cb131939bf0747e072e40f6 (diff)
parent3fd99be98a91416dae77d65fe593965a0723fa8c (diff)
downloadlibgit2-40879facad0337d954d4904e212af3b36cdb9465.tar.gz
Merge branch 'new-error-handling' into development
Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vector.h b/src/vector.h
index 180edbf7c..5bc27914a 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -44,6 +44,8 @@ GIT_INLINE(const void *) git_vector_get_const(const git_vector *v, unsigned int
return (position < v->length) ? v->contents[position] : NULL;
}
+#define GIT_VECTOR_GET(V,I) ((I) < (V)->length ? (V)->contents[(I)] : NULL)
+
GIT_INLINE(void *) git_vector_last(git_vector *v)
{
return (v->length > 0) ? git_vector_get(v, v->length - 1) : NULL;