Commit ae5ee182befb1bdf11b4455e796548fc18655af6

Emilio Cobos Álvarez 2018-03-17T17:33:48

mailmap: git_vector_get already checks bounds

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/mailmap.c b/src/mailmap.c
index 4a073a2..9c3b834 100644
--- a/src/mailmap.c
+++ b/src/mailmap.c
@@ -267,10 +267,7 @@ git_mailmap_entry *git_mailmap_entry_lookup(
 
 git_mailmap_entry *git_mailmap_entry_byindex(git_mailmap *mailmap, size_t idx)
 {
-	if (idx < git_vector_length(&mailmap->entries))
-		return git_vector_get(&mailmap->entries, idx);
-
-	return NULL;
+	return git_vector_get(&mailmap->entries, idx);
 }
 
 size_t git_mailmap_entry_count(git_mailmap *mailmap)