mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Remove the CACHE_HASH and INTERN_STRINGS preprocessor symbols.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user