in reply to Re^6: Re-orderable keyed access structure?
in thread Re-orderable keyed access structure?
I don't understand your objection.
sub swap_elements_by_idx { my ( $i, $j ) = @_; @actual_data[ $i, $j ] = @actual_data[ $j, $i ]; @key_for{ $i, $j } = @key_for{ $j, $i }; # note this is a hash now @index_of{ @key_for[ $i, $j ] } = @index_of{ @key_for[ $j, $i ] }; }
And it doesn't work any differently for multi-element atomic operations.
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Re-orderable keyed access structure?
by BrowserUk (Patriarch) on Aug 14, 2004 at 20:53 UTC |