[issue30785] ast.c duplicates STR(CHILD)

2017-06-28 Thread Emily Morehouse

Emily Morehouse added the comment:

Thanks Christopher, you are absolutely correct. There are a few ways in which 
this code could be optimized (and many other small optimizations probably exist 
elsewhere in the code).

If you are interested in submitting a PR for this, you are more than welcome to 
and I can re-open the issue. Otherwise, I'm going to close it out as this is 
not a critical optimization.

--
nosy: +emilyemorehouse
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30785] ast.c duplicates STR(CHILD)

2017-06-27 Thread Christopher Aycock

New submission from Christopher Aycock:

The function alias_for_import_name() duplicates logic starting at 
Python/ast.c:3237

char *sch = STR(CHILD(n, i));
strcpy(s, STR(CHILD(n, i)));
s += strlen(sch);
*s++ = '.';

I assume the strcpy() is supposed to use the sch value from the line above. 
There shouldn't be any consequence to the code as it currently is; I just 
noticed it while reading through the source.

--
components: Interpreter Core
messages: 297018
nosy: Christopher Aycock
priority: normal
severity: normal
status: open
title: ast.c duplicates STR(CHILD)
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com