/* * 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 | 18760 | rlranft |
Populate -o //guest/perforce_software/p4/... //guest/rlranft/p4/.... |
||
//guest/perforce_software/p4/2015-1/support/intarray.h | |||||
#1 | 15903 | Matt Attaway | Everything should be happy now between the Workshop and the depot paths | ||
//guest/perforce_software/p4/2015_1/support/intarray.h | |||||
#1 | 15901 | Matt Attaway | Clean up code to fit modern Workshop naming standards | ||
//guest/perforce_software/p4/2015.1/support/intarray.h | |||||
#1 | 12190 | Matt Attaway | Initial drop of 2015.1 p4/p4api source |