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
nexedi
ZODB
Commits
7cefcd47
Commit
7cefcd47
authored
Jun 12, 2002
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BTree_getstate(): Documented what it returns.
parent
2a74054a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
+29
-2
src/BTrees/BTreeTemplate.c
src/BTrees/BTreeTemplate.c
+29
-2
No files found.
src/BTrees/BTreeTemplate.c
View file @
7cefcd47
...
...
@@ -12,7 +12,7 @@
****************************************************************************/
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.4
5 2002/06/11 20:26:10
tim_one Exp $\n"
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.4
6 2002/06/12 20:51:46
tim_one Exp $\n"
/*
** _BTree_get
...
...
@@ -592,6 +592,33 @@ err:
return
NULL
;
}
/*
* Return:
*
* For an empty BTree (self->len == 0), None.
*
* For a BTree with one child (self->len == 1), and that child is a bucket,
* and that bucket has a NULL oid, a one-tuple containing a one-tuple
* containing the bucket's state:
*
* (
* (
* child[0].__getstate__(),
* ),
* )
*
* Else a two-tuple. The first element is a tuple interleaving the BTree's
* keys and direct children, of size 2*self->len - 1 (key[0] is unused and
* is not saved). The second element is the firstbucket:
*
* (
* (child[0], key[1], child[1], key[2], child[2], ...,
* key[len-1], child[len-1]),
* self->firstbucket
* )
*
* In the above, key[i] means self->data[i].key, and similarly for child[i].
*/
static
PyObject
*
BTree_getstate
(
BTree
*
self
,
PyObject
*
args
)
{
...
...
@@ -611,7 +638,7 @@ BTree_getstate(BTree *self, PyObject *args)
#endif
)
{
/* We have just one bucket. Save it
'
s data directly. */
/* We have just one bucket. Save its data directly. */
UNLESS
(
o
=
bucket_getstate
(
BUCKET
(
self
->
data
->
child
),
NULL
))
goto
err
;
PyTuple_SET_ITEM
(
r
,
0
,
o
);
ASSIGN
(
r
,
Py_BuildValue
(
"(O)"
,
r
));
...
...
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