Skip to content

Commit 0ba2718

Browse files
committed
hash.h: drop unsafe_ function variants
Now that all callers have been converted from: the_hash_algo->unsafe_init_fn(); to unsafe_hash_algo(the_hash_algo)->init_fn(); and similar, we can remove the scaffolding for the unsafe_ function variants and force callers to use the new unsafe_hash_algo() mechanic instead. Signed-off-by: Taylor Blau <[email protected]>
1 parent da97157 commit 0ba2718

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

hash.h

-15
Original file line numberDiff line numberDiff line change
@@ -282,21 +282,6 @@ struct git_hash_algo {
282282
/* The hash finalization function for object IDs. */
283283
git_hash_final_oid_fn final_oid_fn;
284284

285-
/* The non-cryptographic hash initialization function. */
286-
git_hash_init_fn unsafe_init_fn;
287-
288-
/* The non-cryptographic hash context cloning function. */
289-
git_hash_clone_fn unsafe_clone_fn;
290-
291-
/* The non-cryptographic hash update function. */
292-
git_hash_update_fn unsafe_update_fn;
293-
294-
/* The non-cryptographic hash finalization function. */
295-
git_hash_final_fn unsafe_final_fn;
296-
297-
/* The non-cryptographic hash finalization function. */
298-
git_hash_final_oid_fn unsafe_final_oid_fn;
299-
300285
/* The OID of the empty tree. */
301286
const struct object_id *empty_tree;
302287

object-file.c

-15
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,6 @@ const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {
230230
.update_fn = git_hash_unknown_update,
231231
.final_fn = git_hash_unknown_final,
232232
.final_oid_fn = git_hash_unknown_final_oid,
233-
.unsafe_init_fn = git_hash_unknown_init,
234-
.unsafe_clone_fn = git_hash_unknown_clone,
235-
.unsafe_update_fn = git_hash_unknown_update,
236-
.unsafe_final_fn = git_hash_unknown_final,
237-
.unsafe_final_oid_fn = git_hash_unknown_final_oid,
238233
.empty_tree = NULL,
239234
.empty_blob = NULL,
240235
.null_oid = NULL,
@@ -250,11 +245,6 @@ const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {
250245
.update_fn = git_hash_sha1_update,
251246
.final_fn = git_hash_sha1_final,
252247
.final_oid_fn = git_hash_sha1_final_oid,
253-
.unsafe_init_fn = git_hash_sha1_init_unsafe,
254-
.unsafe_clone_fn = git_hash_sha1_clone_unsafe,
255-
.unsafe_update_fn = git_hash_sha1_update_unsafe,
256-
.unsafe_final_fn = git_hash_sha1_final_unsafe,
257-
.unsafe_final_oid_fn = git_hash_sha1_final_oid_unsafe,
258248
.unsafe = &sha1_unsafe_algo,
259249
.empty_tree = &empty_tree_oid,
260250
.empty_blob = &empty_blob_oid,
@@ -271,11 +261,6 @@ const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {
271261
.update_fn = git_hash_sha256_update,
272262
.final_fn = git_hash_sha256_final,
273263
.final_oid_fn = git_hash_sha256_final_oid,
274-
.unsafe_init_fn = git_hash_sha256_init,
275-
.unsafe_clone_fn = git_hash_sha256_clone,
276-
.unsafe_update_fn = git_hash_sha256_update,
277-
.unsafe_final_fn = git_hash_sha256_final,
278-
.unsafe_final_oid_fn = git_hash_sha256_final_oid,
279264
.empty_tree = &empty_tree_oid_sha256,
280265
.empty_blob = &empty_blob_oid_sha256,
281266
.null_oid = &null_oid_sha256,

0 commit comments

Comments
 (0)