MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / setLen

Method setLen

chapter18/src/main/java/com/seaofnodes/simple/Ary.java:96–104  ·  view source on GitHub ↗
( int len )

Source from the content-addressed store, hash-verified

94 }
95
96 public Ary<E> setLen( int len ) {
97 if( len > _len )
98 while( len>= _es.length ) _es = Arrays.copyOf(_es,_es.length<<1);
99 _len = len;
100 while( _es.length > (len<<1) ) // Shrink if hugely too large
101 _es = Arrays.copyOf(_es,_es.length>>1);
102 Arrays.fill(_es,len,_es.length,null);
103 return this;
104 }
105
106 public void swap( int i, int j ) {
107 range_check(i);

Callers 1

popMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected