class Thor::CoreExt::OrderedHash
def delete(key)
def delete(key) if node = @hash[key] # rubocop:disable AssignmentInCondition prev_node = node.prev next_node = node.next next_node.prev = prev_node if next_node prev_node.next = next_node if prev_node @first = next_node if @first == node @last = prev_node if @last == node value = node.value end @hash.delete(key) value end