minor: don't use strlen if we don't have to

This commit is contained in:
Mike Dirolf 2009-09-02 15:40:31 -04:00
parent 33bfd2b33a
commit bf2b906532

View File

@ -991,9 +991,8 @@ static PyObject* get_value(const char* buffer, int* position, int type) {
case 13:
case 14:
{
int value_length;
int value_length = ((int*)(buffer + *position))[0] - 1;
*position += 4;
value_length = strlen(buffer + *position);
value = PyUnicode_DecodeUTF8(buffer + *position, value_length, "strict");
if (!value) {
return NULL;