Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
8fd36a69
Commit
8fd36a69
authored
Jun 10, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify cc_invalidate() because None is no longer a valid argument.
parent
4f57e3f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
51 deletions
+21
-51
src/Persistence/cPickleCache.c
src/Persistence/cPickleCache.c
+7
-17
src/ZODB/cPickleCache.c
src/ZODB/cPickleCache.c
+7
-17
src/persistent/cPickleCache.c
src/persistent/cPickleCache.c
+7
-17
No files found.
src/Persistence/cPickleCache.c
View file @
8fd36a69
...
@@ -88,7 +88,7 @@ process must skip such objects, rather than deactivating them.
...
@@ -88,7 +88,7 @@ process must skip such objects, rather than deactivating them.
static
char
cPickleCache_doc_string
[]
=
static
char
cPickleCache_doc_string
[]
=
"Defines the PickleCache used by ZODB Connection objects.
\n
"
"Defines the PickleCache used by ZODB Connection objects.
\n
"
"
\n
"
"
\n
"
"$Id: cPickleCache.c,v 1.6
6 2002/06/10 22:35:08
jeremy Exp $
\n
"
;
"$Id: cPickleCache.c,v 1.6
7 2002/06/10 22:49:41
jeremy Exp $
\n
"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
#define UNLESS(E) if(!(E))
...
@@ -425,23 +425,16 @@ static PyObject *
...
@@ -425,23 +425,16 @@ static PyObject *
cc_invalidate
(
ccobject
*
self
,
PyObject
*
args
)
cc_invalidate
(
ccobject
*
self
,
PyObject
*
args
)
{
{
PyObject
*
inv
,
*
key
,
*
v
;
PyObject
*
inv
,
*
key
,
*
v
;
int
i
;
int
i
=
0
;
/* XXX The code supports invalidation of all objects, but it's
/* Older versions of ZODB used None to mean "invalidate everything,"
impossible for a Connection object to pass None. The code could be
but current Connection implementations don't ever pass None.
simplied.
*/
*/
assert
(
key
!=
Py_None
);
if
(
PyArg_ParseTuple
(
args
,
"O!"
,
&
PyDict_Type
,
&
inv
))
{
if
(
PyArg_ParseTuple
(
args
,
"O!"
,
&
PyDict_Type
,
&
inv
))
{
for
(
i
=
0
;
PyDict_Next
(
inv
,
&
i
,
&
key
,
&
v
);
)
while
(
PyDict_Next
(
inv
,
&
i
,
&
key
,
&
v
))
if
(
key
==
Py_None
)
{
_invalidate
(
self
,
key
);
/* Eek some nitwit invalidated everything! */
for
(
i
=
0
;
PyDict_Next
(
self
->
data
,
&
i
,
&
key
,
&
v
);
)
_invalidate
(
self
,
key
);
break
;
}
else
_invalidate
(
self
,
key
);
PyDict_Clear
(
inv
);
PyDict_Clear
(
inv
);
}
}
else
{
else
{
...
@@ -450,9 +443,6 @@ cc_invalidate(ccobject *self, PyObject *args)
...
@@ -450,9 +443,6 @@ cc_invalidate(ccobject *self, PyObject *args)
return
NULL
;
return
NULL
;
if
(
PyString_Check
(
inv
))
if
(
PyString_Check
(
inv
))
_invalidate
(
self
,
inv
);
_invalidate
(
self
,
inv
);
else
if
(
inv
==
Py_None
)
/* All */
for
(
i
=
0
;
PyDict_Next
(
self
->
data
,
&
i
,
&
key
,
&
v
);
)
_invalidate
(
self
,
key
);
else
{
else
{
int
l
;
int
l
;
...
...
src/ZODB/cPickleCache.c
View file @
8fd36a69
...
@@ -88,7 +88,7 @@ process must skip such objects, rather than deactivating them.
...
@@ -88,7 +88,7 @@ process must skip such objects, rather than deactivating them.
static
char
cPickleCache_doc_string
[]
=
static
char
cPickleCache_doc_string
[]
=
"Defines the PickleCache used by ZODB Connection objects.
\n
"
"Defines the PickleCache used by ZODB Connection objects.
\n
"
"
\n
"
"
\n
"
"$Id: cPickleCache.c,v 1.6
6 2002/06/10 22:35:08
jeremy Exp $
\n
"
;
"$Id: cPickleCache.c,v 1.6
7 2002/06/10 22:49:41
jeremy Exp $
\n
"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
#define UNLESS(E) if(!(E))
...
@@ -425,23 +425,16 @@ static PyObject *
...
@@ -425,23 +425,16 @@ static PyObject *
cc_invalidate
(
ccobject
*
self
,
PyObject
*
args
)
cc_invalidate
(
ccobject
*
self
,
PyObject
*
args
)
{
{
PyObject
*
inv
,
*
key
,
*
v
;
PyObject
*
inv
,
*
key
,
*
v
;
int
i
;
int
i
=
0
;
/* XXX The code supports invalidation of all objects, but it's
/* Older versions of ZODB used None to mean "invalidate everything,"
impossible for a Connection object to pass None. The code could be
but current Connection implementations don't ever pass None.
simplied.
*/
*/
assert
(
key
!=
Py_None
);
if
(
PyArg_ParseTuple
(
args
,
"O!"
,
&
PyDict_Type
,
&
inv
))
{
if
(
PyArg_ParseTuple
(
args
,
"O!"
,
&
PyDict_Type
,
&
inv
))
{
for
(
i
=
0
;
PyDict_Next
(
inv
,
&
i
,
&
key
,
&
v
);
)
while
(
PyDict_Next
(
inv
,
&
i
,
&
key
,
&
v
))
if
(
key
==
Py_None
)
{
_invalidate
(
self
,
key
);
/* Eek some nitwit invalidated everything! */
for
(
i
=
0
;
PyDict_Next
(
self
->
data
,
&
i
,
&
key
,
&
v
);
)
_invalidate
(
self
,
key
);
break
;
}
else
_invalidate
(
self
,
key
);
PyDict_Clear
(
inv
);
PyDict_Clear
(
inv
);
}
}
else
{
else
{
...
@@ -450,9 +443,6 @@ cc_invalidate(ccobject *self, PyObject *args)
...
@@ -450,9 +443,6 @@ cc_invalidate(ccobject *self, PyObject *args)
return
NULL
;
return
NULL
;
if
(
PyString_Check
(
inv
))
if
(
PyString_Check
(
inv
))
_invalidate
(
self
,
inv
);
_invalidate
(
self
,
inv
);
else
if
(
inv
==
Py_None
)
/* All */
for
(
i
=
0
;
PyDict_Next
(
self
->
data
,
&
i
,
&
key
,
&
v
);
)
_invalidate
(
self
,
key
);
else
{
else
{
int
l
;
int
l
;
...
...
src/persistent/cPickleCache.c
View file @
8fd36a69
...
@@ -88,7 +88,7 @@ process must skip such objects, rather than deactivating them.
...
@@ -88,7 +88,7 @@ process must skip such objects, rather than deactivating them.
static
char
cPickleCache_doc_string
[]
=
static
char
cPickleCache_doc_string
[]
=
"Defines the PickleCache used by ZODB Connection objects.
\n
"
"Defines the PickleCache used by ZODB Connection objects.
\n
"
"
\n
"
"
\n
"
"$Id: cPickleCache.c,v 1.6
6 2002/06/10 22:35:08
jeremy Exp $
\n
"
;
"$Id: cPickleCache.c,v 1.6
7 2002/06/10 22:49:41
jeremy Exp $
\n
"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
#define UNLESS(E) if(!(E))
...
@@ -425,23 +425,16 @@ static PyObject *
...
@@ -425,23 +425,16 @@ static PyObject *
cc_invalidate
(
ccobject
*
self
,
PyObject
*
args
)
cc_invalidate
(
ccobject
*
self
,
PyObject
*
args
)
{
{
PyObject
*
inv
,
*
key
,
*
v
;
PyObject
*
inv
,
*
key
,
*
v
;
int
i
;
int
i
=
0
;
/* XXX The code supports invalidation of all objects, but it's
/* Older versions of ZODB used None to mean "invalidate everything,"
impossible for a Connection object to pass None. The code could be
but current Connection implementations don't ever pass None.
simplied.
*/
*/
assert
(
key
!=
Py_None
);
if
(
PyArg_ParseTuple
(
args
,
"O!"
,
&
PyDict_Type
,
&
inv
))
{
if
(
PyArg_ParseTuple
(
args
,
"O!"
,
&
PyDict_Type
,
&
inv
))
{
for
(
i
=
0
;
PyDict_Next
(
inv
,
&
i
,
&
key
,
&
v
);
)
while
(
PyDict_Next
(
inv
,
&
i
,
&
key
,
&
v
))
if
(
key
==
Py_None
)
{
_invalidate
(
self
,
key
);
/* Eek some nitwit invalidated everything! */
for
(
i
=
0
;
PyDict_Next
(
self
->
data
,
&
i
,
&
key
,
&
v
);
)
_invalidate
(
self
,
key
);
break
;
}
else
_invalidate
(
self
,
key
);
PyDict_Clear
(
inv
);
PyDict_Clear
(
inv
);
}
}
else
{
else
{
...
@@ -450,9 +443,6 @@ cc_invalidate(ccobject *self, PyObject *args)
...
@@ -450,9 +443,6 @@ cc_invalidate(ccobject *self, PyObject *args)
return
NULL
;
return
NULL
;
if
(
PyString_Check
(
inv
))
if
(
PyString_Check
(
inv
))
_invalidate
(
self
,
inv
);
_invalidate
(
self
,
inv
);
else
if
(
inv
==
Py_None
)
/* All */
for
(
i
=
0
;
PyDict_Next
(
self
->
data
,
&
i
,
&
key
,
&
v
);
)
_invalidate
(
self
,
key
);
else
{
else
{
int
l
;
int
l
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment