Skip to content

Commit

Permalink
lru_cache should take advantage of ordered dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasgoergens committed Aug 13, 2022
1 parent 1402d2c commit ce1adb3
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 277 deletions.
3 changes: 3 additions & 0 deletions Include/cpython/dictobject.h
Expand Up @@ -28,6 +28,8 @@ typedef struct {
PyDictValues *ma_values;
} PyDictObject;

PyAPI_FUNC(PyObject *) _PyDict_GetAndPushBack_KnownHash(
PyObject *op, PyObject *key, Py_hash_t hash);
PyAPI_FUNC(PyObject *) _PyDict_GetItem_KnownHash(PyObject *mp, PyObject *key,
Py_hash_t hash);
PyAPI_FUNC(PyObject *) _PyDict_GetItemWithError(PyObject *dp, PyObject *key);
Expand All @@ -42,6 +44,7 @@ PyAPI_FUNC(int) _PyDict_DelItem_KnownHash(PyObject *mp, PyObject *key,
Py_hash_t hash);
PyAPI_FUNC(int) _PyDict_DelItemIf(PyObject *mp, PyObject *key,
int (*predicate)(PyObject *value));
PyAPI_FUNC(int) _PyDict_DelNext(PyDictObject *, Py_ssize_t *);
PyAPI_FUNC(int) _PyDict_Next(
PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash);

Expand Down

0 comments on commit ce1adb3

Please sign in to comment.