This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Dead assignment in config_init_module_search_paths
Type: performance Stage: resolved
Components: Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: alex.henrie, vstinner
Priority: normal Keywords: patch

Created on 2020-01-09 04:14 by alex.henrie, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17914 merged alex.henrie, 2020-01-09 04:17
Messages (2)
msg359652 - (view) Author: Alex Henrie (alex.henrie) * Date: 2020-01-09 04:14
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
msg359659 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-01-09 09:14
New changeset f3e5e9566989635225d1b91088888074fc260817 by Victor Stinner (Alex Henrie) in branch 'master':
bpo-39270: Remove dead assignment from config_init_module_search_paths (GH-17914)
https://github.com/python/cpython/commit/f3e5e9566989635225d1b91088888074fc260817
History
Date User Action Args
2022-04-11 14:59:25adminsetgithub: 83451
2020-01-09 09:14:32vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-01-09 09:14:15vstinnersetnosy: + vstinner
messages: + msg359659
2020-01-09 04:17:04alex.henriesetkeywords: + patch
stage: patch review
pull_requests: + pull_request17326
2020-01-09 04:14:48alex.henriecreate