removed floating point operation

This commit is contained in:
Arvid Norberg 2009-12-26 11:15:12 +00:00
parent 7412931183
commit baa6ea74b8
1 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE.
namespace
{
const float lazy_entry_grow_factor = 1.5f;
const int lazy_entry_grow_factor = 150; // percent
const int lazy_entry_dict_init = 5;
const int lazy_entry_list_init = 5;
}
@ -199,7 +199,7 @@ namespace libtorrent
}
else if (m_size == m_capacity)
{
int capacity = m_capacity * lazy_entry_grow_factor;
int capacity = m_capacity * lazy_entry_grow_factor / 100;
lazy_dict_entry* tmp = new (std::nothrow) lazy_dict_entry[capacity];
if (tmp == 0) return 0;
std::memcpy(tmp, m_data.dict, sizeof(lazy_dict_entry) * m_size);
@ -341,7 +341,7 @@ namespace libtorrent
}
else if (m_size == m_capacity)
{
int capacity = m_capacity * lazy_entry_grow_factor;
int capacity = m_capacity * lazy_entry_grow_factor / 100;
lazy_entry* tmp = new (std::nothrow) lazy_entry[capacity];
if (tmp == 0) return 0;
std::memcpy(tmp, m_data.list, sizeof(lazy_entry) * m_size);