Skip to content

Commit

Permalink
use build-in functions
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Sep 28, 2022
1 parent 2b9635f commit e55af6e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2022.09.28, Version 0.0.21

* Use build-in function.

2022.09.28, Version 0.0.20

* Added `use_tuples` unpack argument (pr #5).
Expand Down
2 changes: 1 addition & 1 deletion qpack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
except ImportError as ex:
from .fallback import packb, unpackb

__version_info__ = (0, 0, 20)
__version_info__ = (0, 0, 21)
__version__ = '.'.join(map(str, __version_info__))
__all__ = ['packb', 'unpackb']
16 changes: 3 additions & 13 deletions qpack/_qpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,19 +1112,9 @@ static PyObject * unpackb(
}
if (options->use_tuples)
{
Py_ssize_t i, size = PyList_Size(obj);
o = PyTuple_New(size);
if (o != NULL)
{
for (i = 0; i < size; i++)
{
PyObject * v = PyList_GetItem(obj, i);
Py_INCREF(v);
PyTuple_SET_ITEM(o, i, v);
}
Py_DECREF(obj);
return o;
}
o = PyList_AsTuple(obj);
Py_DECREF(obj);
return o;
}
return obj;
}
Expand Down

0 comments on commit e55af6e

Please sign in to comment.