shithub: Nail

Download patch

ref: 479b69e45275a5304b7df014c8f0f0ad60423c53
parent: 74c01104800ced699d26b9f025626e60874799f9
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Nov 13 15:14:04 EST 2020

cleanup: remove temporary variables

we can copy them over to m before we copy m to p.

--- a/mbox.c
+++ b/mbox.c
@@ -342,8 +342,7 @@
 static Mesg*
 load(char *name, char *digest, int ins)
 {
-	Mesg *m, *p, **c;
-	int nc, ns;
+	Mesg *m, *p;
 
 	if(strncmp(name, mbox.path, strlen(mbox.path)) == 0)
 		name += strlen(mbox.path);
@@ -354,17 +353,14 @@
 		goto error;
 	/* if we already have a dummy, populate it */
 	if((p = lookupid(m->messageid)) != nil){
-		c = p->child;
-		nc = p->nchild;
-		ns = p->nsub;
+		m->child = p->child;
+		m->nchild = p->nchild;
+		m->nsub = p->nsub;
 		mesgclear(p);
 		memcpy(p, m, sizeof(*p));
 		free(m);
-
 		m = p;
-		m->child = c;
-		m->nchild = nc;
-		m->nsub = ns;
+
 	}else
 		addmesg(m, ins);