# HG changeset patch # User Adrian Buehlmann # Date 2012-09-30 21:53:56 # Node ID c6c7e466dd3a1d6af55b7f270530b64a7cf2927d # Parent eb7f8359249a8f4d1b534ac7218518ad96b5d1cc 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 @@ static Py_ssize_t basicencode(char *dest 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;