def adjust_offsets(after_child, delta)
      node = self

      while node
        adjust = false
        0.upto(node.children.size - 1) do |i|
          # Iterate over the children until we have found the after_child
          # node. Then turn on adjustment mode. The offsets of the following
          # entries will be adjusted by delta.
          if adjust
            node.offsets[i] += delta
          elsif node.children[i] == after_child
            adjust = true
          end
        end

        unless adjust
          node.fatal "Could not find child #{after_child._id}"
        end

        after_child = node
        node = node.parent
      end
    end
def adjust_offsets(after_child, delta)
      node = self

      while node
        adjust = false
        0.upto(node.children.size - 1) do |i|
          # Iterate over the children until we have found the after_child
          # node. Then turn on adjustment mode. The offsets of the following
          # entries will be adjusted by delta.
          if adjust
            node.offsets[i] += delta
          elsif node.children[i] == after_child
            adjust = true
          end
        end

        unless adjust
          node.fatal "Could not find child #{after_child._id}"
        end

        after_child = node
        node = node.parent
      end
    end
This method takes care of adjusting the offsets in tree in case elements
 were inserted or removed. All nodes that hold children after the
 insert/remove operation needs to be adjusted. Since child nodes get their
 offsets via their parents, only the parent node and the direct ancestor
 followers need to be adjusted.
 @param after_child [BigArrayNode] specifies the modified leaf node
 @param delta [Integer] specifies how many elements were inserted or
        removed.