summaryrefslogtreecommitdiff
path: root/src/diff_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/diff_driver.c')
-rw-r--r--src/diff_driver.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/diff_driver.c b/src/diff_driver.c
index 9bc266e02..342ac247a 100644
--- a/src/diff_driver.c
+++ b/src/diff_driver.c
@@ -233,8 +233,8 @@ static int git_diff_driver_load(
{
int error = 0;
git_diff_driver_registry *reg;
- git_diff_driver *drv = NULL;
- size_t namelen, pos;
+ git_diff_driver *drv;
+ size_t namelen;
git_config *cfg = NULL;
git_buf name = GIT_BUF_INIT;
git_config_entry *ce = NULL;
@@ -243,9 +243,8 @@ static int git_diff_driver_load(
if ((reg = git_repository_driver_registry(repo)) == NULL)
return -1;
- pos = git_strmap_lookup_index(reg->drivers, driver_name);
- if (git_strmap_valid_index(reg->drivers, pos)) {
- *out = git_strmap_value_at(reg->drivers, pos);
+ if ((drv = git_strmap_get(reg->drivers, driver_name)) != NULL) {
+ *out = drv;
return 0;
}