Commit 52e27b84 by Edward Thomson

reader: free is unused and unnecessary

None of the reader implementations actually allocate anything
themselves, so they don't need a free function.  Remove it.
parent 47cc5f85
......@@ -47,11 +47,6 @@ done:
return error;
}
static void tree_reader_free(git_reader *_reader)
{
GIT_UNUSED(_reader);
}
int git_reader_for_tree(git_reader **out, git_tree *tree)
{
tree_reader *reader;
......@@ -62,7 +57,6 @@ int git_reader_for_tree(git_reader **out, git_tree *tree)
GITERR_CHECK_ALLOC(reader);
reader->reader.read = tree_reader_read;
reader->reader.free = tree_reader_free;
reader->tree = tree;
*out = (git_reader *)reader;
......@@ -129,11 +123,6 @@ done:
return error;
}
static void workdir_reader_free(git_reader *_reader)
{
GIT_UNUSED(_reader);
}
int git_reader_for_workdir(
git_reader **out,
git_repository *repo,
......@@ -148,7 +137,6 @@ int git_reader_for_workdir(
GITERR_CHECK_ALLOC(reader);
reader->reader.read = workdir_reader_read;
reader->reader.free = workdir_reader_free;
reader->repo = repo;
if (validate_index &&
......@@ -196,11 +184,6 @@ done:
return error;
}
static void index_reader_free(git_reader *_reader)
{
GIT_UNUSED(_reader);
}
int git_reader_for_index(
git_reader **out,
git_repository *repo,
......@@ -215,7 +198,6 @@ int git_reader_for_index(
GITERR_CHECK_ALLOC(reader);
reader->reader.read = index_reader_read;
reader->reader.free = index_reader_free;
reader->repo = repo;
if (index) {
......@@ -247,6 +229,5 @@ void git_reader_free(git_reader *reader)
if (!reader)
return;
reader->free(reader);
git__free(reader);
}
......@@ -26,7 +26,6 @@ typedef struct git_reader git_reader;
*/
struct git_reader {
int (*read)(git_buf *out, git_oid *out_oid, git_reader *reader, const char *filename);
void (*free)(git_reader *reader);
};
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment