Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b15d4d89
Commit
b15d4d89
authored
13 years ago
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PyUnicode_CopyCharacters() marks the string as dirty (reset the hash)
parent
f5ca1a21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
Objects/unicodeobject.c
Objects/unicodeobject.c
+5
-1
No files found.
Objects/unicodeobject.c
View file @
b15d4d89
...
...
@@ -117,6 +117,9 @@ extern "C" {
(assert(PyUnicode_Check(op)), \
((PyASCIIObject *)(op))->length)
/* The Unicode string has been modified: reset the hash */
#define _PyUnicode_DIRTY(op) do { _PyUnicode_HASH(op) = -1; } while (0)
/* This dictionary holds all interned unicode strings. Note that references
to strings in this dictionary are *not* counted in the string's ob_refcnt.
...
...
@@ -356,7 +359,7 @@ unicode_resize(register PyUnicodeObject *unicode,
_PyUnicode_STATE
(
unicode
).
interned
=
_PyUnicode_STATE
(
unicode
).
interned
;
_PyUnicode_STATE
(
unicode
).
kind
=
PyUnicode_WCHAR_KIND
;
}
_PyUnicode_
HASH
(
unicode
)
=
-
1
;
_PyUnicode_
DIRTY
(
unicode
)
;
return
0
;
}
...
...
@@ -639,6 +642,7 @@ PyUnicode_CopyCharacters(PyObject *to, Py_ssize_t to_start,
"Cannot modify a string having more than 1 reference"
);
return
-
1
;
}
_PyUnicode_DIRTY
(
unicode
);
from_kind
=
PyUnicode_KIND
(
from
);
to_kind
=
PyUnicode_KIND
(
to
);
...
...
This diff is collapsed.
Click to expand it.
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