Commit 0c4ad4e1 authored by Jim Fulton's avatar Jim Fulton

Fixed bug in reinitialization code.

parent e1c2c430
......@@ -53,7 +53,7 @@
static char Trie_module_documentation[] =
""
"\n$Id: Trie.c,v 1.5 1997/03/20 19:30:04 jim Exp $"
"\n$Id: Trie.c,v 1.6 1997/04/03 15:53:48 jim Exp $"
;
......@@ -143,6 +143,20 @@ Trie__p___reinit__(TrieObject *self, PyObject *args)
{
PyObject *oid, *jar, *copy;
if(PyArg_ParseTuple(args, ""))
{
if(self->state==cPersistent_UPTODATE_STATE)
{
Py_XDECREF(self->bins);
Py_XDECREF(self->value);
self->bins=NULL;
self->value=NULL;
self->min=0;
self->state=cPersistent_GHOST_STATE;
}
}
else
{
UNLESS(PyArg_ParseTuple(args, "OOO", &oid, &jar, &copy)) return NULL;
UNLESS(self->oid)
{
......@@ -159,6 +173,7 @@ Trie__p___reinit__(TrieObject *self, PyObject *args)
self->min=0;
self->state=cPersistent_GHOST_STATE;
}
}
Py_INCREF(Py_None);
return Py_None;
}
......@@ -647,7 +662,7 @@ void
initTrie()
{
PyObject *m, *d;
char *rev="$Revision: 1.5 $";
char *rev="$Revision: 1.6 $";
UNLESS(ExtensionClassImported) return;
......@@ -687,6 +702,9 @@ initTrie()
Revision Log:
$Log: Trie.c,v $
Revision 1.6 1997/04/03 15:53:48 jim
Fixed bug in reinitialization code.
Revision 1.5 1997/03/20 19:30:04 jim
Major rewrite to use more efficient data structure. In particular,
try to avoid one-element tries by storing partial-key/value tuples
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment