Closed caryyu closed 4 months ago
I don't think that is a bug. That line is used only when AIndex >= 0
, ie the caller wants to extract data from a specific index in the buffer. When AIndex < 0
, the data is extracted from FHeadIndex
instead. So, unless you have a very specific example where ExtractToBytes()
is not working correctly with AIndex >= 0
, I'm going to close this ticket.
If that is the case, how come the indexOf
involves the FHeadIndex
, I think the concept in here should be unified, you can extend the parameters for giving the choices out. sometimes these two concepts are very confusing by using TIdBuffer.
Perhaps, but most people don't use TIdBuffer
directly, and the current logic has been in place for a very long time, so it hasn't been a problem under normal usage. So again, can you please provide a real-world example where you think there a problem exists?
Closed as I eventually chose not to directly use TIdBuffer but wrapped one myself instead.
https://github.com/IndySockets/Indy/blob/40ba7a2b08bb05a2269dd52f281a3dd9349a4974/Lib/Core/IdBuffer.pas#L545