SevenZip/SevenZipExtractor.cs
/// <summary>
///   Produces an array of indexes from 0 to the maximum value in the specified array
/// </summary>
/// <param name = "indexes">The source array</param>
/// <returns>The array of indexes from 0 to the maximum value in the specified array</returns>
Produces an array of indexes from 0 to the maximum value in the specified array
Produces an array of indexes from 0 to the maximum value in the specified array
private static uint[] SolidIndexes(uint[] indexes)
        {
#if CS4
            int max = indexes.Aggregate(0, (current, i) => Math.Max(current, (int) i));
#else
            int max = 0;
            foreach (uint i in indexes)
            {
                max = Math.Max(max, (int) i);
            }
#endif
            if (max > 0)
            {
                max++;
                var res = new uint[max];
                for (int i = 0; i < max; i++)
                {
                    res[i] = (uint) i;
                }
                return res;
            }
            return indexes;
        }
private static uint [ ] SolidIndexes ( uint [ ] indexes ) { if CS4 int max = indexes . Aggregate ( 0 , ( current , i ) => Math . Max ( current , ( int ) i ) ) ; else int max = 0 ; foreach ( uint i in indexes ) { max = Math . Max ( max , ( int ) i ) ; } endif if ( max > 0 ) { max ++ ; var res = new uint [ max ] ; for ( int i = 0 ; i < max ; i ++ ) { res [ i ] = ( uint ) i ; } return res ; } return indexes ; }
Produces an array of indexes from 0 to the maximum value in the specified array
Produces an array of indexes from 0 to the maximum value in the specified array
The array of indexes from 0 to the maximum value in the specified array
The array of indexes from 0 to the maximum value in the specified array
indexes
uint[]
The source array
The source array