summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-03-07 15:54:45 (GMT)
committerGuido van Rossum <guido@python.org>2000-03-07 15:54:45 (GMT)
commit9611e0b4620988310c15122e3d14deadb2efbb35 (patch)
tree2dfc0a75d6385d7946e67aba759a6156ef946e33 /Objects
parent9284a572bc22c31a965ebc03d428ec6145f70c73 (diff)
downloadcpython-9611e0b4620988310c15122e3d14deadb2efbb35.zip
cpython-9611e0b4620988310c15122e3d14deadb2efbb35.tar.gz
cpython-9611e0b4620988310c15122e3d14deadb2efbb35.tar.bz2
Patch by Moshe Zadka: remove the string special case in
PySequence_Contains() now that string objects have this code in their tp_contains.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 739d9d9..970d80f 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -1121,24 +1121,6 @@ PySequence_Contains(w, v) /* v in w */
PyObject *x;
PySequenceMethods *sq;
- /* Special case for char in string */
- if (PyString_Check(w)) {
- register char *s, *end;
- register char c;
- if (!PyString_Check(v) || PyString_Size(v) != 1) {
- PyErr_SetString(PyExc_TypeError,
- "string member test needs char left operand");
- return -1;
- }
- c = PyString_AsString(v)[0];
- s = PyString_AsString(w);
- end = s + PyString_Size(w);
- while (s < end) {
- if (c == *s++)
- return 1;
- }
- return 0;
- }
if(PyType_HasFeature(w->ob_type, Py_TPFLAGS_HAVE_SEQUENCE_IN)) {
sq = w->ob_type->tp_as_sequence;
if(sq != NULL && sq->sq_contains != NULL)