##// END OF EJS Templates
pathencode: use Py_SIZE directly...
Gregory Szorc -
r30102:a8c948ee default
parent child Browse files
Show More
@@ -171,7 +171,8 b' PyObject *encodedir(PyObject *self, PyOb'
171 newobj = PyBytes_FromStringAndSize(NULL, newlen);
171 newobj = PyBytes_FromStringAndSize(NULL, newlen);
172
172
173 if (newobj) {
173 if (newobj) {
174 PyBytes_GET_SIZE(newobj)--;
174 assert(PyBytes_Check(newobj));
175 Py_SIZE(newobj)--;
175 _encodedir(PyBytes_AS_STRING(newobj), newlen, path,
176 _encodedir(PyBytes_AS_STRING(newobj), newlen, path,
176 len + 1);
177 len + 1);
177 }
178 }
@@ -638,7 +639,8 b' static PyObject *hashmangle(const char *'
638 memcopy(dest, &destlen, destsize, &src[lastdot],
639 memcopy(dest, &destlen, destsize, &src[lastdot],
639 len - lastdot - 1);
640 len - lastdot - 1);
640
641
641 PyBytes_GET_SIZE(ret) = destlen;
642 PyBytes_Check(ret);
643 Py_SIZE(ret) = destlen;
642
644
643 return ret;
645 return ret;
644 }
646 }
@@ -750,7 +752,8 b' PyObject *pathencode(PyObject *self, PyO'
750 newobj = PyBytes_FromStringAndSize(NULL, newlen);
752 newobj = PyBytes_FromStringAndSize(NULL, newlen);
751
753
752 if (newobj) {
754 if (newobj) {
753 PyBytes_GET_SIZE(newobj)--;
755 PyBytes_Check(newobj);
756 Py_SIZE(newobj)--;
754 basicencode(PyBytes_AS_STRING(newobj), newlen, path,
757 basicencode(PyBytes_AS_STRING(newobj), newlen, path,
755 len + 1);
758 len + 1);
756 }
759 }
General Comments 0
You need to be logged in to leave comments. Login now