diff --git a/BAN/BAN/String.cpp b/BAN/BAN/String.cpp index cf71211c..4f119981 100644 --- a/BAN/BAN/String.cpp +++ b/BAN/BAN/String.cpp @@ -199,7 +199,7 @@ namespace BAN { if (m_capasity >= size) return {}; - size_type new_cap = BAN::Math::max(size, m_capasity * 1.5f); + size_type new_cap = BAN::Math::max(size, m_capasity * 3 / 2); void* new_data = BAN::allocator(new_cap); if (new_data == nullptr) return Error::FromString("String: Could not allocate memory"); diff --git a/BAN/include/BAN/Queue.h b/BAN/include/BAN/Queue.h index 506f5997..4ba475bc 100644 --- a/BAN/include/BAN/Queue.h +++ b/BAN/include/BAN/Queue.h @@ -95,7 +95,7 @@ namespace BAN if (m_capacity > size) return {}; - size_type new_cap = BAN::Math::max(m_capacity * 1.5f, m_capacity + 1); + size_type new_cap = BAN::Math::max(size, m_capacity * 3 / 2); void* new_data = BAN::allocator(new_cap * sizeof(T)); if (new_data == nullptr) return Error::FromString("Queue: Could not allocate memory"); diff --git a/BAN/include/BAN/Vector.h b/BAN/include/BAN/Vector.h index e7d63fd5..3e2af8db 100644 --- a/BAN/include/BAN/Vector.h +++ b/BAN/include/BAN/Vector.h @@ -207,7 +207,7 @@ namespace BAN { if (m_capasity >= size) return {}; - size_type new_cap = BAN::Math::max(size, m_capasity * 1.5f); + size_type new_cap = BAN::Math::max(size, m_capasity * 3 / 2); void* new_data = BAN::allocator(new_cap * sizeof(T)); if (new_data == nullptr) return Error::FromString("Vector: Could not allocate memory");