Update and clarify documentation comments (#5206)

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Ernesto García <ernestognw@gmail.com>
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
cairo
2024-09-23 17:17:10 +02:00
committed by Hadrien Croubois
parent 5b952079df
commit ce7376ea8a
8 changed files with 77 additions and 71 deletions

View File

@ -49,8 +49,9 @@ library CircularBuffer {
* directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and
* lead to unexpected behavior.
*
* The last item is at data[(index - 1) % data.length] and the last item is at data[index % data.length]. This
* range can wrap around.
* In a full buffer:
* - The most recently pushed item (last) is at data[(index - 1) % data.length]
* - The oldest item (first) is at data[index % data.length]
*/
struct Bytes32CircularBuffer {
uint256 _count;