# HG changeset patch # User Gregory Szorc # Date 2016-10-13 08:59:29 # Node ID 27e00e6352ceadb48c11c6f5902093a26d58f569 # Parent 733fb9f7bc92c694ba6bededaeb93206528c0bcd dirs: add comment about _PyBytes_Resize So readers have a canonical function to compare this code to. diff --git a/mercurial/dirs.c b/mercurial/dirs.c --- a/mercurial/dirs.c +++ b/mercurial/dirs.c @@ -59,7 +59,8 @@ static int _addpath(PyObject *dirs, PyOb * "protocol" such as mutating immutable objects. But since we only * mutate objects created in this function or in other well-defined * locations, the references are known so these violations should go - * unnoticed. */ + * unnoticed. The code for adjusting the length of a PyBytesObject is + * essentially a minimal version of _PyBytes_Resize. */ while ((pos = _finddir(cpath, pos - 1)) != -1) { PyObject *val;