[New-bugs-announce] [issue39270] Dead assignment in config_init_module_search_paths

Alex Henrie report at bugs.python.org
Wed Jan 8 23:14:48 EST 2020


New submission from Alex Henrie <alexhenrie24 at gmail.com>:

config_init_module_search_paths currently has the following code:

    const wchar_t *p = sys_path;
    while (1) {
        p = wcschr(sys_path, delim);

The first assignment to p is unnecessary because it is immediately overwritten. Victor Stinner suggested moving the variable declaration into the loop itself to clarify that it does not need to be initialized elsewhere: https://github.com/python/cpython/pull/16267/files#r364216448

----------
messages: 359652
nosy: alex.henrie
priority: normal
severity: normal
status: open
title: Dead assignment in config_init_module_search_paths
type: performance
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39270>
_______________________________________


More information about the New-bugs-announce mailing list