mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Remove the CACHE_HASH and INTERN_STRINGS preprocessor symbols.
This commit is contained in:
parent
835840560b
commit
1f7df3595a
6 changed files with 19 additions and 102 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue