kernel/common/array.rb
# Deletes every element from self for which block evaluates to true
Deletes every element from self for which block evaluates to true
Deletes every element from self for which block evaluates to true
def delete_if(&block)
    key = Undefined
    i = @start
    tot = @start + @total
    while(i < tot)
      if(yield(@tuple.at(i)))
        @tuple.put(i, key)
      end
      i+=1
    end
    if((deleted = @tuple.delete(@start,@total,key)) > 0)
      @total -= deleted
      reallocate_shrink()
    end
    return self
  end
def delete_if ( & block ) key = Undefined i = @start tot = @start + @total while ( i < tot ) if ( yield ( @tuple . at ( i ) ) ) @tuple . put ( i , key ) end i += 1 end if ( ( deleted = @tuple . delete ( @start , @total , key ) ) > 0 ) @total -= deleted reallocate_shrink ( ) end return self end
Deletes every element from self for which block evaluates to true
Deletes every element from self for which block evaluates to true
block
<not_specific>