summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-03-29 03:29:08 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-03-29 03:29:08 (GMT)
commit1f7df3595a0ddc5ef545d686bbb2933b11b7c8ce (patch)
tree6f6774880044bab55c1ba90903e75976912b8e23 /Objects/dictobject.c
parent835840560bdd9edcf21186bace543e316fe921ca (diff)
downloadcpython-1f7df3595a0ddc5ef545d686bbb2933b11b7c8ce.zip
cpython-1f7df3595a0ddc5ef545d686bbb2933b11b7c8ce.tar.gz
cpython-1f7df3595a0ddc5ef545d686bbb2933b11b7c8ce.tar.bz2
Remove the CACHE_HASH and INTERN_STRINGS preprocessor symbols.
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r--Objects/dictobject.c42
1 files changed, 8 insertions, 34 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index a83a851..f4cf0df 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -480,10 +480,8 @@ PyDict_GetItem(PyObject *op, PyObject *key)
if (!PyDict_Check(op)) {
return NULL;
}
-#ifdef CACHE_HASH
if (!PyString_CheckExact(key) ||
(hash = ((PyStringObject *) key)->ob_shash) == -1)
-#endif
{
hash = PyObject_Hash(key);
if (hash == -1) {
@@ -512,24 +510,18 @@ PyDict_SetItem(register PyObject *op, PyObject *key, PyObject *value)
return -1;
}
mp = (dictobject *)op;
-#ifdef CACHE_HASH
if (PyString_CheckExact(key)) {
-#ifdef INTERN_STRINGS
if (((PyStringObject *)key)->ob_sinterned != NULL) {
key = ((PyStringObject *)key)->ob_sinterned;
hash = ((PyStringObject *)key)->ob_shash;
}
- else
-#endif
- {
+ else {
hash = ((PyStringObject *)key)->ob_shash;
if (hash == -1)
hash = PyObject_Hash(key);
}
}
- else
-#endif
- {
+ else {
hash = PyObject_Hash(key);
if (hash == -1)
return -1;
@@ -564,11 +556,8 @@ PyDict_DelItem(PyObject *op, PyObject *key)
PyErr_BadInternalCall();
return -1;
}
-#ifdef CACHE_HASH
if (!PyString_CheckExact(key) ||
- (hash = ((PyStringObject *) key)->ob_shash) == -1)
-#endif
- {
+ (hash = ((PyStringObject *) key)->ob_shash) == -1) {
hash = PyObject_Hash(key);
if (hash == -1)
return -1;
@@ -844,11 +833,8 @@ dict_subscript(dictobject *mp, register PyObject *key)
PyObject *v;
long hash;
assert(mp->ma_table != NULL);
-#ifdef CACHE_HASH
if (!PyString_CheckExact(key) ||
- (hash = ((PyStringObject *) key)->ob_shash) == -1)
-#endif
- {
+ (hash = ((PyStringObject *) key)->ob_shash) == -1) {
hash = PyObject_Hash(key);
if (hash == -1)
return NULL;
@@ -1436,11 +1422,8 @@ dict_has_key(register dictobject *mp, PyObject *key)
{
long hash;
register long ok;
-#ifdef CACHE_HASH
if (!PyString_CheckExact(key) ||
- (hash = ((PyStringObject *) key)->ob_shash) == -1)
-#endif
- {
+ (hash = ((PyStringObject *) key)->ob_shash) == -1) {
hash = PyObject_Hash(key);
if (hash == -1)
return NULL;
@@ -1460,11 +1443,8 @@ dict_get(register dictobject *mp, PyObject *args)
if (!PyArg_ParseTuple(args, "O|O:get", &key, &failobj))
return NULL;
-#ifdef CACHE_HASH
if (!PyString_CheckExact(key) ||
- (hash = ((PyStringObject *) key)->ob_shash) == -1)
-#endif
- {
+ (hash = ((PyStringObject *) key)->ob_shash) == -1) {
hash = PyObject_Hash(key);
if (hash == -1)
return NULL;
@@ -1489,11 +1469,8 @@ dict_setdefault(register dictobject *mp, PyObject *args)
if (!PyArg_ParseTuple(args, "O|O:setdefault", &key, &failobj))
return NULL;
-#ifdef CACHE_HASH
if (!PyString_CheckExact(key) ||
- (hash = ((PyStringObject *) key)->ob_shash) == -1)
-#endif
- {
+ (hash = ((PyStringObject *) key)->ob_shash) == -1) {
hash = PyObject_Hash(key);
if (hash == -1)
return NULL;
@@ -1725,11 +1702,8 @@ dict_contains(dictobject *mp, PyObject *key)
{
long hash;
-#ifdef CACHE_HASH
if (!PyString_CheckExact(key) ||
- (hash = ((PyStringObject *) key)->ob_shash) == -1)
-#endif
- {
+ (hash = ((PyStringObject *) key)->ob_shash) == -1) {
hash = PyObject_Hash(key);
if (hash == -1)
return -1;