[issue37752] Redundant Py_CHARMASK called in normalizestring(codecs.c)

2019-08-03 Thread Jordon.X


Jordon.X <9651...@qq.com> added the comment:

Thanks Ma,I also think all these redundant Py_CHARMASK should be deleted.

--

___
Python tracker 

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



[issue37752] Redundant Py_CHARMASK called in normalizestring(codecs.c)

2019-08-03 Thread Ma Lin


Ma Lin  added the comment:

Or remove Py_CHARMASK in Py_ISxxx/Py_TOLOWER/Py_TOUPPER macros?
Sometimes `c` is already a unsinged char, Py_CHARMASK is not necessary in these 
cases.

--

___
Python tracker 

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



[issue37752] Redundant Py_CHARMASK called in normalizestring(codecs.c)

2019-08-03 Thread Ma Lin


Ma Lin  added the comment:

Search "Py_CHARMASK" in Python source code, there are more than a dozen 
Py_CHARMASK can be deleted:

https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/mystrtoul.c#L102

https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/dynload_aix.c#L143

https://github.com/python/cpython/blob/530f506ac91338b55cf2be71b1cdf50cb077512f/Modules/unicodedata.c#L963

...

--
nosy: +Ma Lin

___
Python tracker 

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



[issue37752] Redundant Py_CHARMASK called in normalizestring(codecs.c)

2019-08-03 Thread Jordon.X


Jordon.X <9651...@qq.com> added the comment:

Thanks Hai, for your careful check. There is a misoperation in PR 15093. Now I 
closed PR 15093. And resubmit code as PR 15095.

--

___
Python tracker 

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



[issue37752] Redundant Py_CHARMASK called in normalizestring(codecs.c)

2019-08-03 Thread Jordon.X


Change by Jordon.X <9651...@qq.com>:


--
pull_requests: +14842
pull_request: https://github.com/python/cpython/pull/15095

___
Python tracker 

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



[issue37752] Redundant Py_CHARMASK called in normalizestring(codecs.c)

2019-08-03 Thread hai shi


hai shi  added the comment:

Looks the PR is confused. Make sure: one PR on one dev branch.

--

___
Python tracker 

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



[issue37752] Redundant Py_CHARMASK called in normalizestring(codecs.c)

2019-08-03 Thread Jordon.X


Change by Jordon.X <9651...@qq.com>:


--
keywords: +patch, patch
pull_requests: +14839, 14840
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15093

___
Python tracker 

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



[issue37752] Redundant Py_CHARMASK called in normalizestring(codecs.c)

2019-08-03 Thread Jordon.X


Change by Jordon.X <9651...@qq.com>:


--
keywords: +patch
pull_requests: +14839
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15093

___
Python tracker 

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



[issue37752] Redundant Py_CHARMASK called in normalizestring(codecs.c)

2019-08-03 Thread hai shi


hai shi  added the comment:

Good catch ;), try to fix it, thanks.

--
nosy: +shihai1991

___
Python tracker 

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



[issue37752] Redundant Py_CHARMASK called in normalizestring(codecs.c)

2019-08-03 Thread Jordon.X


New submission from Jordon.X <9651...@qq.com>:

In normalizestring(),
ch = Py_TOLOWER(Py_CHARMASK(ch));
Where Py_TOLOWER is defined as following,
#define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)])

Redundant Py_CHARMASK called here.

--
components: Unicode
messages: 348955
nosy: ezio.melotti, qigangxu, vstinner
priority: normal
severity: normal
status: open
title: Redundant Py_CHARMASK called in normalizestring(codecs.c)
type: performance
versions: Python 3.9

___
Python tracker 

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