added boolean helpers to check buffer state#5
Open
Sreshty-Beshty wants to merge 1 commit intoLearnPRG-py:mainfrom
Open
added boolean helpers to check buffer state#5Sreshty-Beshty wants to merge 1 commit intoLearnPRG-py:mainfrom
Sreshty-Beshty wants to merge 1 commit intoLearnPRG-py:mainfrom
Conversation
LearnPRG-py
requested changes
Apr 8, 2026
| } | ||
| } | ||
|
|
||
| // checks if buffer is empty |
| return entriesAdded == 0; | ||
| } | ||
|
|
||
| // checks if buffer is full |
| // checks if buffer is full | ||
|
|
||
| bool is_full() { | ||
| return entriesAdded == N; |
Owner
There was a problem hiding this comment.
This would cause an overflow and cause this to be inaccurate
in push_back(), entries_added++ happens, hence it is possible in cycle mode that entriesAdded is actually > N. Maybe address this with >=
Owner
There was a problem hiding this comment.
also size() exists in the same struct you may want to consider that as a safer approach that doesnt use >=
Owner
There was a problem hiding this comment.
We'd also likely have to update examples perhaps. You can have comments there about calling the functions and their purpose.
Owner
|
Owner
|
Also there's conflicts now: have fun with that :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
solves Issue: #3