Remove the CACHE_HASH and INTERN_STRINGS preprocessor symbols.

This commit is contained in:
Tim Peters 2002-03-29 03:29:08 +00:00
parent 835840560b
commit 1f7df3595a
6 changed files with 19 additions and 102 deletions

View file

@ -10,9 +10,7 @@ typedef struct {
void *b_ptr;
int b_size;
int b_readonly;
#ifdef CACHE_HASH
long b_hash;
#endif
} PyBufferObject;
@ -36,9 +34,7 @@ _PyBuffer_FromMemory(PyObject *base, void *ptr, int size, int readonly)
b->b_ptr = ptr;
b->b_size = size;
b->b_readonly = readonly;
#ifdef CACHE_HASH
b->b_hash = -1;
#endif
return (PyObject *) b;
}
@ -152,9 +148,7 @@ PyBuffer_New(int size)
b->b_ptr = (void *)(b + 1);
b->b_size = size;
b->b_readonly = 0;
#ifdef CACHE_HASH
b->b_hash = -1;
#endif
return o;
}
@ -211,10 +205,8 @@ buffer_hash(PyBufferObject *self)
register unsigned char *p;
register long x;
#ifdef CACHE_HASH
if ( self->b_hash != -1 )
return self->b_hash;
#endif
if ( !self->b_readonly )
{
@ -231,9 +223,7 @@ buffer_hash(PyBufferObject *self)
x ^= self->b_size;
if (x == -1)
x = -2;
#ifdef CACHE_HASH
self->b_hash = x;
#endif
return x;
}