Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
0ec031fa
Commit
0ec031fa
authored
Dec 29, 2016
by
Claudio Freire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize hashes during string init to enable hash-compare optimization
parent
17b1f1fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
Cython/Utility/StringTools.c
Cython/Utility/StringTools.c
+4
-0
No files found.
Cython/Utility/StringTools.c
View file @
0ec031fa
...
@@ -14,6 +14,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
...
@@ -14,6 +14,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
//////////////////// InitStrings ////////////////////
//////////////////// InitStrings ////////////////////
static
int
__Pyx_InitStrings
(
__Pyx_StringTabEntry
*
t
)
{
static
int
__Pyx_InitStrings
(
__Pyx_StringTabEntry
*
t
)
{
long
hash
;
while
(
t
->
p
)
{
while
(
t
->
p
)
{
#if PY_MAJOR_VERSION < 3
#if PY_MAJOR_VERSION < 3
if
(
t
->
is_unicode
)
{
if
(
t
->
is_unicode
)
{
...
@@ -38,6 +39,9 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
...
@@ -38,6 +39,9 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
#endif
#endif
if
(
!*
t
->
p
)
if
(
!*
t
->
p
)
return
-
1
;
return
-
1
;
hash
=
PyObject_Hash
(
*
t
->
p
);
if
(
hash
==
-
1
)
PyErr_Clear
();
++
t
;
++
t
;
}
}
return
0
;
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment