ref: 6b27ba3b533936cf05cbc5c37f5a7119b3183c72
parent: 9ead7ebfb44bb32440eceb8205e54d94476b8761
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Sep 6 12:07:08 EDT 2020
packs, deltas: remove dead code
--- a/delta.c
+++ b/delta.c
@@ -26,12 +26,6 @@
int sz;
};
-static u64int
-addh(u64int h, uchar v)
-{
- return h + v;
-}
-
static void
addblk(Dtab *dt, void *buf, int len, int off, u64int rh)
{
--- a/pack.c
+++ b/pack.c
@@ -286,26 +286,6 @@
}
static int
-hashsearch(Hash *hlist, int nent, Hash h)
-{
- int hi, lo, mid, d;
-
- lo = 0;
- hi = nent;
- while(lo < hi){
- mid = (lo + hi)/2;
- d = memcmp(hlist[mid].h, h.h, sizeof h.h);
- if(d < 0)
- lo = mid + 1;
- else if(d > 0)
- hi = mid;
- else
- return mid;
- }
- return -1;
-}
-
-static int
applydelta(Object *dst, Object *base, char *d, int nd)
{
char *r, *b, *ed, *er;
@@ -919,7 +899,8 @@
cache(obj);
return obj;
error:
- Bterm(f);
+ if(f != nil)
+ Bterm(f);
free(d);
free(new);
return nil;
@@ -1165,8 +1146,6 @@
static void
addmeta(Objmeta **m, int *nm, int type, Hash h, char *path, vlong mtime)
{
- static Objset os;
-
*m = erealloc(*m, (*nm + 1)*sizeof(Objmeta));
memset(&(*m)[*nm], 0, sizeof(Objmeta));
(*m)[*nm].type = type;
--- a/repack.c
+++ b/repack.c
@@ -1,6 +1,5 @@
#include <u.h>
#include <libc.h>
-#include <pool.h>
#include "git.h"