[PATCH 03 of 11 V1] pathencode: simplify basicencode

Adrian Buehlmann adrian at cadifra.com
Sun Sep 30 16:56:40 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1349042036 -7200
# Node ID c7f9dcccc54236fb8675fe7cc3a87ca21461300d
# Parent  cb7a710fd409d3932ae474a7baa77f78123b0ea6
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