You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ruby_non_concurrent_priority_queue.rb
    path of file: ./repos/concurrent-ruby/lib/concurrent-ruby/concurrent/collection
    
    the code of the file until where you have to start completion: module Concurrent
  module Collection

    # @!macro priority_queue
    # 
    # @!visibility private
    # @!m
    
      def swim(k)
        success = false

        while k > 1 && ! ordered?(k/2, k) do
          swap(k, k/2)
          k = k/2
          success = true
        end

        success
      end