[PATCH] pathencode: simplify basicencode

Adrian Buehlmann adrian at cadifra.com
Fri Sep 21 19:05:07 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1348271928 -7200
# Node ID 5609454a3837c970cc14ca8bf23e92ce9b7622fd
# Parent  ff5ed1ecd43a8940d2e93cab53ac8187a97c35ea
pathencode: simplify basicencode

diff --git a/mercurial/pathencode.c b/mercurial/pathencode.c
--- a/mercurial/pathencode.c
+++ b/mercurial/pathencode.c
@@ -475,15 +475,8 @@
 
 	Py_ssize_t destlen = 0;
 
-	if (len < 5 || memcmp(src, "data/", 5) != 0) {
-		memcopy(dest, &destlen, destsize, src, len);
-		return destlen;
-	}
-
-	memcopy(dest, &destlen, destsize, "data/", 5);
-
 	return _encode(twobytes, onebyte, dest, destlen, destsize,
-		       src + 5, len - 5, 1);
+		       src, len, 1);
 }
 
 static const Py_ssize_t maxstorepathlen = 120;


More information about the Mercurial-devel mailing list