FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-93829: In sqlite3, replace Py_BuildValue with faster APIs by erlend-aasland · Pull Request #93830 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
3 changes: 1 addition & 2 deletions Modules/_sqlite/connection.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1582,9 +1582,8 @@ static PyObject* pysqlite_connection_get_total_changes(pysqlite_Connection* self
{
if (!pysqlite_check_connection(self)) {
return NULL;
} else {
return Py_BuildValue("i", sqlite3_total_changes(self->db));
}
return PyLong_FromLong(sqlite3_total_changes(self->db));
}

static PyObject* pysqlite_connection_get_in_transaction(pysqlite_Connection* self, void* unused)
Expand Down
4 changes: 2 additions & 2 deletions Modules/_sqlite/microprotocols.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pysqlite_microprotocols_add(pysqlite_state *state, PyTypeObject *type,

assert(type != NULL);
assert(proto != NULL);
key = Py_BuildValue("(OO)", (PyObject*)type, proto);
key = PyTuple_Pack(2, (PyObject *)type, proto);
if (!key) {
return -1;
}
Expand All @@ -81,7 +81,7 @@ pysqlite_microprotocols_adapt(pysqlite_state *state, PyObject *obj,
way to get a quotable object to be its instance */

/* look for an adapter in the registry */
key = Py_BuildValue("(OO)", (PyObject*)Py_TYPE(obj), proto);
key = PyTuple_Pack(2, (PyObject *)Py_TYPE(obj), proto);
if (!key) {
return NULL;
}
Expand Down

Back | FazBrowse Home | New Git URL