Branch data Line data Source code
1 : : // $Id: IntSet.cc 80 2004-07-14 20:15:50Z jason $
2 : :
3 : : #include "config.h"
4 : :
5 : : #ifdef HAVE_MEMORY_H
6 : : #include <memory.h>
7 : : #endif
8 : : #include <stdlib.h>
9 : :
10 : : #include "IntSet.h"
11 : :
12 : 885 : void IntSet::Expand(unsigned int i)
13 : : {
14 : 885 : unsigned int newsize = i / 8 + 1;
15 : 885 : unsigned char* newset = new unsigned char[newsize];
16 : :
17 : 885 : memset(newset, 0, newsize);
18 : 885 : memcpy(newset, set, size);
19 : :
20 [ + - ]: 885 : delete [] set;
21 : 885 : size = newsize;
22 : 885 : set = newset;
23 : 885 : }
|