Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-132983: Simplify_zstd_exec()#133775

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
AA-Turner merged 6 commits intopython:mainfromAA-Turner:zstd-exec
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from1 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
PrevPrevious commit
NextNext commit
Remove unused variables from module state
  • Loading branch information
@AA-Turner
AA-Turner committedMay 9, 2025
commitdaf2e315cf290dfad24f4b22d4691f8145b813ea
30 changes: 0 additions & 30 deletionsModules/_zstd/_zstdmodule.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -634,14 +634,6 @@ add_vars_to_module(PyObject *m)
return 0;
}

#define ADD_STR_TO_STATE_MACRO(STR) \
do { \
mod_state->str_##STR = PyUnicode_FromString(#STR); \
if (mod_state->str_##STR == NULL) { \
return -1; \
} \
} while(0)

static inline int
add_constant_to_type(PyTypeObject *type, const char *name, long value)
{
Expand DownExpand Up@@ -678,18 +670,6 @@ do { \
return -1;
}

mod_state->empty_readonly_memoryview =
PyMemoryView_FromMemory((char*)mod_state, 0, PyBUF_READ);
if (mod_state->empty_readonly_memoryview == NULL) {
return -1;
}

/* Add str to module state */
ADD_STR_TO_STATE_MACRO(read);
ADD_STR_TO_STATE_MACRO(readinto);
ADD_STR_TO_STATE_MACRO(write);
ADD_STR_TO_STATE_MACRO(flush);

mod_state->CParameter_type = NULL;
mod_state->DParameter_type = NULL;

Expand DownExpand Up@@ -744,11 +724,6 @@ _zstd_traverse(PyObject *module, visitproc visit, void *arg)
_zstd_state* const mod_state = get_zstd_state(module);

Py_VISIT(mod_state->empty_bytes);
Py_VISIT(mod_state->empty_readonly_memoryview);
Py_VISIT(mod_state->str_read);
Py_VISIT(mod_state->str_readinto);
Py_VISIT(mod_state->str_write);
Py_VISIT(mod_state->str_flush);

Py_VISIT(mod_state->ZstdDict_type);
Py_VISIT(mod_state->ZstdCompressor_type);
Expand All@@ -768,11 +743,6 @@ _zstd_clear(PyObject *module)
_zstd_state* const mod_state = get_zstd_state(module);

Py_CLEAR(mod_state->empty_bytes);
Py_CLEAR(mod_state->empty_readonly_memoryview);
Py_CLEAR(mod_state->str_read);
Py_CLEAR(mod_state->str_readinto);
Py_CLEAR(mod_state->str_write);
Py_CLEAR(mod_state->str_flush);

Py_CLEAR(mod_state->ZstdDict_type);
Py_CLEAR(mod_state->ZstdCompressor_type);
Expand Down
5 changes: 0 additions & 5 deletionsModules/_zstd/_zstdmodule.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,11 +36,6 @@ extern PyType_Spec zstd_decompressor_type_spec;

struct _zstd_state {
PyObject *empty_bytes;
PyObject *empty_readonly_memoryview;
PyObject *str_read;
PyObject *str_readinto;
PyObject *str_write;
PyObject *str_flush;

PyTypeObject *ZstdDict_type;
PyTypeObject *ZstdCompressor_type;
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp