for ( Slot slot = oldHash[i]; slot != null; slot = slot.rest() ) { int k; if ( ( k = slot.arraykey( newArraySize ) ) > 0 ) { StrongSlot entry = slot.first(); if (entry != null) newArray[ k - 1 ] = entry.value(); } else { int j = slot.keyindex( newHashMask ); newHash[j] = slot.relink( newHash[j] ); ? newHash[slot].add( newEntry ) : newEntry;
for ( Slot slot = oldHash[i]; slot != null; slot = slot.rest() ) { int k; if ( ( k = slot.arraykey( newArraySize ) ) > 0 ) { StrongSlot entry = slot.first(); if (entry != null) newArray[ k - 1 ] = entry.value(); } else { int j = slot.keyindex( newHashMask ); newHash[j] = slot.relink( newHash[j] ); ? newHash[slot].add( newEntry ) : newEntry;
for ( Slot slot = oldHash[i]; slot != null; slot = slot.rest() ) { int k; if ( ( k = slot.arraykey( newArraySize ) ) > 0 ) { StrongSlot entry = slot.first(); if (entry != null) newArray[ k - 1 ] = entry.value(); } else { int j = slot.keyindex( newHashMask ); newHash[j] = slot.relink( newHash[j] ); ? newHash[slot].add( newEntry ) : newEntry;
i = hashSlot( key ); boolean found = false; for ( Slot slot = hash[i]; slot != null; slot = slot.rest() ) { if ( found ) { StrongSlot nextEntry = slot.first(); if ( nextEntry != null ) { return nextEntry.toVarargs(); } else if ( slot.keyeq( key ) ) { found = true; Slot slot = hash[i]; while ( slot != null ) { StrongSlot first = slot.first(); if ( first != null ) return first.toVarargs(); slot = slot.rest();
i = hashSlot( key ); boolean found = false; for ( Slot slot = hash[i]; slot != null; slot = slot.rest() ) { if ( found ) { StrongSlot nextEntry = slot.first(); if ( nextEntry != null ) { return nextEntry.toVarargs(); } else if ( slot.keyeq( key ) ) { found = true; Slot slot = hash[i]; while ( slot != null ) { StrongSlot first = slot.first(); if ( first != null ) return first.toVarargs(); slot = slot.rest();
i = hashSlot( key ); boolean found = false; for ( Slot slot = hash[i]; slot != null; slot = slot.rest() ) { if ( found ) { StrongSlot nextEntry = slot.first(); if ( nextEntry != null ) { return nextEntry.toVarargs(); } else if ( slot.keyeq( key ) ) { found = true; Slot slot = hash[i]; while ( slot != null ) { StrongSlot first = slot.first(); if ( first != null ) return first.toVarargs(); slot = slot.rest();
if ( hash.length > 0 ) { index = hashSlot( key ); for ( Slot slot = hash[ index ]; slot != null; slot = slot.rest() ) { StrongSlot foundSlot; if ( ( foundSlot = slot.find( key ) ) != null ) { hash[index] = hash[index].set( foundSlot, value ); return; ? m_metatable.entry( key, value ) : defaultEntry( key, value ); hash[ index ] = ( hash[index] != null ) ? hash[index].add( entry ) : entry; ++hashEntries;
if ( hash.length > 0 ) { index = hashSlot( key ); for ( Slot slot = hash[ index ]; slot != null; slot = slot.rest() ) { StrongSlot foundSlot; if ( ( foundSlot = slot.find( key ) ) != null ) { hash[index] = hash[index].set( foundSlot, value ); return; ? m_metatable.entry( key, value ) : defaultEntry( key, value ); hash[ index ] = ( hash[index] != null ) ? hash[index].add( entry ) : entry; ++hashEntries;
if ( hash.length > 0 ) { index = hashSlot( key ); for ( Slot slot = hash[ index ]; slot != null; slot = slot.rest() ) { StrongSlot foundSlot; if ( ( foundSlot = slot.find( key ) ) != null ) { hash[index] = hash[index].set( foundSlot, value ); return; ? m_metatable.entry( key, value ) : defaultEntry( key, value ); hash[ index ] = ( hash[index] != null ) ? hash[index].add( entry ) : entry; ++hashEntries;
private int countIntKeys(int[] nums) { int total = 0; int i = 1; // Count integer keys in array part for ( int bit = 0; bit < 31; ++bit ) { if ( i > array.length ) break; int j = Math.min(array.length, 1 << bit); int c = 0; while ( i <= j ) { if ( array[ i++ - 1 ] != null ) c++; } nums[bit] = c; total += c; } // Count integer keys in hash part for ( i = 0; i < hash.length; ++i ) { for ( Slot s = hash[i]; s != null; s = s.rest() ) { int k; if ( ( k = s.arraykey(Integer.MAX_VALUE) ) > 0 ) { nums[log2(k)]++; total++; } } } return total; }
private int countIntKeys(int[] nums) { int total = 0; int i = 1; // Count integer keys in array part for ( int bit = 0; bit < 31; ++bit ) { if ( i > array.length ) break; int j = Math.min(array.length, 1 << bit); int c = 0; while ( i <= j ) { if ( array[ i++ - 1 ] != null ) c++; } nums[bit] = c; total += c; } // Count integer keys in hash part for ( i = 0; i < hash.length; ++i ) { for ( Slot s = hash[i]; s != null; s = s.rest() ) { int k; if ( ( k = s.arraykey(Integer.MAX_VALUE) ) > 0 ) { nums[log2(k)]++; total++; } } } return total; }
private int countIntKeys(int[] nums) { int total = 0; int i = 1; // Count integer keys in array part for ( int bit = 0; bit < 31; ++bit ) { if ( i > array.length ) break; int j = Math.min(array.length, 1 << bit); int c = 0; while ( i <= j ) { if ( array[ i++ - 1 ] != null ) c++; } nums[bit] = c; total += c; } // Count integer keys in hash part for ( i = 0; i < hash.length; ++i ) { for ( Slot s = hash[i]; s != null; s = s.rest() ) { int k; if ( ( k = s.arraykey(Integer.MAX_VALUE) ) > 0 ) { nums[log2(k)]++; total++; } } } return total; }
@Override public Slot set(StrongSlot target, LuaValue value) { LuaValue key = strongkey(); if ( key != null && target.find( key ) != null ) { return set( value ); } else if ( key != null ) { // Our key is still good. next = next.set( target, value ); return this; } else { // our key was dropped, remove ourselves from the chain. return next.set( target, value ); } }
public Slot add( Slot entry ) { return setnext(next.add( entry )); }
public Slot add(Slot newEntry) { return ( next != null ) ? next.add(newEntry) : newEntry; }
public Slot add( Slot entry ) { return setnext(next.add( entry )); }
@Override public Slot add(Slot newEntry) { return ( next != null ) ? next.add(newEntry) : newEntry; }
public Slot set(StrongSlot target, LuaValue value) { LuaValue key = strongkey(); if ( key != null && target.find( key ) != null ) { return set( value ); } else if ( key != null ) { // Our key is still good. next = next.set( target, value ); return this; } else { // our key was dropped, remove ourselves from the chain. return next.set( target, value ); } }
@Override public Slot add( Slot entry ) { next = ( next != null ) ? next.add( entry ) : entry; if ( strongkey() != null && strongvalue() != null ) { return this; } else { return next; } }