Skip to content
Merged
Show file tree
Hide file tree
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
Two minor code tidy ups.
  • Loading branch information
markshannon committed Jul 20, 2020
commit a2915d507c60afbfaf394a0fe33ccd65cf2dc7b0
4 changes: 2 additions & 2 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -5882,9 +5882,9 @@ makecode(struct compiler *c, struct assembler *a, PyObject *consts)

names = dict_keys_inorder(c->u->u_names, 0);
varnames = dict_keys_inorder(c->u->u_varnames, 0);
if (!names || !varnames)
if (!names || !varnames) {
goto error;

}
cellvars = dict_keys_inorder(c->u->u_cellvars, 0);
if (!cellvars)
goto error;
Expand Down
7 changes: 2 additions & 5 deletions Python/peephole.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
* Optimization is now done in the compiler */

PyObject *
PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
PyObject *lnotab_obj)
PyCode_Optimize(PyObject *code, PyObject* Py_UNUSED(consts),
PyObject *Py_UNUSED(names), PyObject *Py_UNUSED(lnotab_obj))
{
Py_INCREF(code);
Copy link
Copy Markdown
Member

@pablogsal pablogsal Jul 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Py_UNUSED for the ones that are not code in the function declaration.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

(void)consts;
(void)names;
(void)lnotab_obj;
return code;
}