/*
* Copyright 1995, 1996 Perforce Software. All rights reserved.
*
* This file is part of Perforce - the FAST SCM System.
*/
/*
* intarray.h -- a cheesy, zero-based, automatically resized int array
*/
class IntArray {
public:
IntArray( int nInts = 4 )
{
ints = 0;
lInts = 0;
ReAlloc( nInts );
}
~IntArray()
{
delete []ints;
}
int& operator []( int x )
{
// geometric growth
if( x >= lInts ) ReAlloc( x * 3 / 2 );
return ints[x];
}
private:
void ReAlloc( int nInts )
{
int i = 0;
int *old = ints;
ints = new int[nInts];
for( ; i < lInts; i++ ) ints[i] = old[i];
for( ; i < nInts; i++ ) ints[i] = 0;
lInts = nInts;
delete []old;
}
int lInts;
int *ints;
};
# |
Change |
User |
Description |
Committed |
|
#1
|
15902 |
Matt Attaway |
A second renaming that I will not obliterate as a badge of shame |
|
|
//guest/perforce_software/p4/2014_1/support/intarray.h |
#1
|
15901 |
Matt Attaway |
Clean up code to fit modern Workshop naming standards |
|
|
//guest/perforce_software/p4/2014.1/support/intarray.h |
#1
|
12188 |
Matt Attaway |
Move 'main' p4 into a release specific directory in prep for new releases |
|
|
//guest/perforce_software/p4/support/intarray.h |
#1
|
9129 |
Matt Attaway |
Initial commit of the 2014.1 p4/p4api source code |
|
|