shithub: pplay

Download patch

ref: db8bfd2f8fd0dda83b71af2052dbe8b6d27c6c28
parent: 0ba7c95fb2a11cdecd7ddda8fa4cda791ae34d36
author: qwx <qwx@sciops.net>
date: Sun Jan 29 17:08:20 EST 2023

remove last of merging code

only marginally useful and only with finite undo,
otherwise just complicates everything

--- a/chunk.c
+++ b/chunk.c
@@ -183,44 +183,6 @@
 	b->buf = erealloc(b->buf, newsz, b->bufsz);
 }
 
-#ifdef nope
-static Chunk *
-merge(Chunk *left, Chunk *right)
-{
-	uchar *u;
-	Buf *l, *r;
-	Chunk *nc;
-
-	if(left == right)
-		return left;
-	l = left->b;
-	r = right->b;
-	assert(l != nil && r != nil);
-	nc = newbuf(left->len + right->len);
-	u = nc->b->buf;
-	memcpy(u, l->buf+left->off, left->len);
-	memcpy(u + left->len, r->buf+right->off, right->len);
-	linkchunk(left->left, nc);
-	unlink(left, right);
-	freechain(left);
-	return nc;
-}
-
-Chunk *
-mergedot(usize *off)
-{
-	Chunk *left, *right;
-
-	left = p2c(dot.from, off);
-	right = p2c(dot.to, nil);
-	if(left == right)
-		return left;
-	while(left->right != right)
-		left = merge(left, left->right);
-	return merge(left, right);
-}
-#endif
-
 usize
 chunklen(Chunk *c)
 {
--- a/cmd.c
+++ b/cmd.c
@@ -448,7 +448,6 @@
 	case '|': x = pipeto(s); break;
 	case 'c': x = copy(s); break;
 	case 'd': x = cut(s); break;
-//	case 'm': x = forcemerge(s); break;
 	case 'p': x = paste(s, nil); break;
 	case 'q': threadexitsall(nil);
 	case 'r': x = readfrom(s); break;