Example #1
0
	void peer_class_set::add_class(peer_class_pool& pool, peer_class_t c)
	{
		if (std::find(m_class.begin(), m_class.begin() + m_size, c)
			!= m_class.begin() + m_size) return;
		if (m_size >= m_class.size() - 1)
		{
			assert(false);
			return;
		}
		m_class[m_size] = c;
		pool.incref(c);
		++m_size;
	}
Example #2
0
	void peer_class_set::add_class(peer_class_pool& pool, peer_class_t c)
	{
		if (std::find(m_class.begin(), m_class.begin() + m_size, c)
			!= m_class.begin() + m_size) return;
		if (m_size >= m_class.size() - 1)
		{
			TORRENT_ASSERT_FAIL();
			return;
		}
		m_class[m_size] = c;
		pool.incref(c);
		++m_size;
	}
Example #3
0
	void peer_class_set::add_class(peer_class_pool& pool, peer_class_t c)
	{
		if (std::find(m_class.begin(), m_class.end(), c) != m_class.end()) return;
		m_class.push_back(c);
		pool.incref(c);
	}