[Zope-Checkins] CVS: Zope3/lib/python/Persistence/BTrees - BTreeTemplate.c:1.1.2.28
Tim Peters
tim.one@comcast.net
Mon, 10 Jun 2002 16:40:59 -0400
Update of /cvs-repository/Zope3/lib/python/Persistence/BTrees
In directory cvs.zope.org:/tmp/cvs-serv24579
Modified Files:
Tag: Zope-3x-branch
BTreeTemplate.c
Log Message:
_BTree_set(): Vastly reducing gratuitous differences between the trunk
and Zope3 branch versions of this function. No semantic change.
=== Zope3/lib/python/Persistence/BTrees/BTreeTemplate.c 1.1.2.27 => 1.1.2.28 ===
if (BTree_grow(self, 0, noval) < 0)
return -1;
- } else {
+ }
+ else {
PyErr_SetObject(PyExc_KeyError, keyarg);
return -1;
}
@@ -370,10 +371,10 @@
BTREE_SEARCH(min, self, key, goto err);
d = self->data + min;
if (SameType_Check(self, d->child))
- grew= _BTree_set((BTree *)d->child, keyarg, value, unique, noval);
+ grew = _BTree_set((BTree *)d->child, keyarg, value, unique, noval);
else
- grew=_bucket_set((Bucket *)d->child, keyarg, value, unique, noval,
- &bchanged);
+ grew = _bucket_set((Bucket *)d->child, keyarg, value, unique, noval,
+ &bchanged);
if (grew < 0)
goto err;
@@ -386,14 +387,16 @@
goto err;
changed = 1;
}
- } else {
+ }
+ else {
if (BUCKET(d->child)->len > MAX_BUCKET_SIZE(d->child)) {
if (BTree_grow(self, min, noval) < 0)
goto err;
changed = 1;
}
}
- } else { /* got smaller */
+ }
+ else { /* got smaller */
if (min && grew > 1) {
/* Somebody below us deleted their first bucket and */
/* and an intermediate tree couldn't handle it. */
@@ -411,7 +414,8 @@
it. */
if (Bucket_deleteNextBucket(BUCKET(d[-1].child)) < 0)
goto err;
- } else {
+ }
+ else {
/* If it's the first bucket, we can't adjust the
reference to it ourselves, so we'll just
increment the grew flag to indicate to a
@@ -441,14 +445,16 @@
Py_XINCREF(self->firstbucket);
PyPersist_DECREF(BTREE(self->data->child));
PyPersist_SetATime(BTREE(self->data->child));
- } else {
+ }
+ else {
ASSIGNB(self->firstbucket,
BUCKET(self->data->child));
Py_INCREF(self->firstbucket);
}
/* We can toss our first key now */
DECREF_KEY(self->data->key);
- } else {
+ }
+ else {
Py_XDECREF(self->firstbucket);
self->firstbucket = 0;
}
@@ -463,7 +469,7 @@
|| (bchanged /* The bucket changed */
&& self->len == 1 /* We have only one */
&& ! SameType_Check(self, self->data->child) /* It's our child */
- && BUCKET(self->data->child)->po_oid == NULL /* It's in our record*/
+ && BUCKET(self->data->child)->po_oid == NULL /* It's in our record*/
)
)
if (PyPersist_CHANGED(self) < 0)