8000 bpo-42862: Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module by erlend-aasland · Pull Request #24203 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-42862: Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module #24203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jun 3, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve naming: get_statement => get_statement_from_cache
  • Loading branch information
Erlend E. Aasland committed Jun 3, 2021
commit 401b0575b4dc8cd5b3c0ba144cbcf2269b8a284e
4 changes: 2 additions & 2 deletions Modules/_sqlite/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ static int check_cursor(pysqlite_Cursor* cur)
}

static PyObject *
get_statement(pysqlite_Cursor *self, PyObject *operation)
get_statement_from_cache(pysqlite_Cursor *self, PyObject *operation)
{
PyObject *args[] = { operation, };
PyObject *cache = self->connection->statement_cache;
Expand Down Expand Up @@ -496,7 +496,7 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation
(void)pysqlite_statement_reset(self->statement);
}

PyObject *stmt = get_statement(self, operation);
PyObject *stmt = get_statement_from_cache(self, operation);
Py_XSETREF(self->statement, (pysqlite_Statement *)stmt);
if (!self->statement) {
goto error;
Expand Down
0