lib/geom2d/utils/sorted_linked_list.rb
# Inserts a new node with the given value into the list (at a position decided by the compare
# function) and returns it.
Inserts a new node with the given value into the list (at a position decided by the compare
function) and returns it.
Inserts a new node with the given value into the list ( at a position decided by the compare function ) and returns it .
def insert(value)
        node = Node.new(value)
        current = @anchor.next_node
        while current != @anchor
          if @comparator.call(node.value, current.value)
            return node.insert_before(current)
          end
          current = current.next_node
        end
        node.insert_before(@anchor)
      end
def insert ( value ) node = Node . new ( value ) current = @anchor . next_node while current != @anchor if @comparator . call ( node . value , current . value ) return node . insert_before ( current ) end current = current . next_node end node . insert_before ( @anchor ) end
Inserts a new node with the given value into the list (at a position decided by the compare
function) and returns it.
Inserts a new node with the given value into the list ( at a position decided by the compare function ) and returns it .
value
<not_specific>