pike.git/
src/
multiset.c
Branch:
Tag:
Non-build tags
All tags
No tags
1999-10-29
1999-10-29 03:36:48 by Martin Stjernholm <mast@lysator.liu.se>
361904e6f94984aa79373e9d47618b427ee65bd8 (
19
lines) (+
16
/-
3
)
[
Show
|
Annotate
]
Branch:
7.9
Propagate the flag field correctly when the array is copied.
Rev: src/multiset.c:1.16
16:
#include "gc.h" #include "security.h"
-
RCSID("$Id: multiset.c,v 1.
15
1999/
09
/
24
13:
03:
03
noring
Exp $");
+
RCSID("$Id: multiset.c,v 1.
16
1999/
10
/
29
03:
36:48
mast
Exp $");
struct multiset *first_multiset;
73:
void order_multiset(struct multiset *l) { INT32 *order;
+
int flags;
if(l->ind->size < 2) return; order = get_set_order(l->ind);
-
+
flags = l->ind->flags;
l->ind = order_array(l->ind, order);
-
+
l->ind->flags = flags;
free((char *)order); }
94:
i=set_lookup(l->ind, ind); if(i < 0) {
+
int flags = l->ind->flags;
l->ind=array_insert(l->ind, ind, ~i);
-
+
l->ind->flags = flags;
} }
110:
INT32 i; i=set_lookup(l->ind, ind);
-
if(i >= 0) l->ind=array_remove(l->ind, i);
+
if(i >= 0)
+
{
+
int flags =
l->ind
->flags;
+
l->ind
=array_remove(l->ind, i);
+
l->ind->flags = flags;
}
-
+
}
void check_multiset_for_destruct(struct multiset *l) {
-
/*
Horrifiying
worst case!!!!! */
+
/*
Horrifying
worst case!!!!! */
INT32 i;
-
+
int flags = l->ind->flags;
while( (i=array_find_destructed_object(l->ind)) >= 0) l->ind=array_remove(l->ind, i);
-
+
l->ind->flags = flags;
} struct multiset *copy_multiset(struct multiset *tmp)