Error in ArrayDouble.mqh Resize Method

 

I've found a bug in the CArrayDouble class.

In method Resize(int size), the new size formula is wrong causing the value to be smaller than the requested value:  new_size = m_step_resize * ( 1 + ( size - Available() ) / m_step_resize);

The red text should not exist otherwise some functions like AssignArray, wich call Clear() prior to call the Resize method, setting available space to the whole, may encounter an Array Out Of Range, due to the smaller final resize.


I hope this to be useful.


Regards Gianluca

Documentation on MQL5: MQL5 programs / Runtime Errors
  • www.mql5.com
MQL5 programs / Runtime Errors - Documentation on MQL5
 
Thanks for message. Fixed. Please wait for updates.

Reason: