diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2013-08-08 14:39:32 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-08-08 14:39:32 +0200 |
| commit | eba7399251cfa95d9346b9b41ca78dc5d43a840d (patch) | |
| tree | 60c186b774d8ee0f1130e043366a33edcb0ec5dc /src/config.c | |
| parent | 4efa32903adf131631d283c914e0a5bf29c49e4d (diff) | |
| download | libgit2-eba7399251cfa95d9346b9b41ca78dc5d43a840d.tar.gz | |
config: move next() and free() into the iterator
Like we have in the references iterator, next and free belong in the
iterator itself.
Diffstat (limited to 'src/config.c')
| -rw-r--r-- | src/config.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/config.c b/src/config.c index a4627c9ad..5bec0f040 100644 --- a/src/config.c +++ b/src/config.c @@ -328,7 +328,7 @@ int git_config_backend_foreach_match( void *data) { git_config_entry entry; - git_config_backend_iter* iter; + git_config_iterator* iter; regex_t regex; int result = 0; @@ -340,12 +340,12 @@ int git_config_backend_foreach_match( } } - if ((result = backend->iterator_new(&iter, backend)) < 0) { + if ((result = backend->iterator(&iter, backend)) < 0) { iter = NULL; return -1; } - while(!(backend->next(&entry, iter) < 0)) { + while(!(iter->next(&entry, iter) < 0)) { /* skip non-matching keys if regexp was provided */ if (regexp && regexec(®ex, entry.name, 0, NULL, 0) != 0) continue; @@ -362,7 +362,7 @@ cleanup: if (regexp != NULL) regfree(®ex); - backend->iterator_free(iter); + iter->free(iter); return result; } |
