Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement StringList pop_back() #745

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Implement StringList pop_back() #745

merged 1 commit into from
Jul 11, 2024

Conversation

jeshwanthreddy13
Copy link

Fixes #669

  • Implemented a new "void pop_back()" method.
  • Removes the last string from StringList.
  • Returns false if deallocation fails
  • Panics if StringList is empty.
  • Clears when last string is poped.

Test cases covered:

  • Size should be zero after removing last element from the list.
  • front_ and back_ have to point to same string when initial list with two strings is poped.
  • back_ should point to 'n-1' string after poping initial 'n' number of strings list.

@github-actions github-actions bot added the work in progress Pull request is still in progress and changing label Jul 2, 2024

This comment was marked as outdated.

@jeshwanthreddy13 jeshwanthreddy13 marked this pull request as ready for review July 2, 2024 17:20
@github-actions github-actions bot added ready for review Pull request can be reviewed and removed work in progress Pull request is still in progress and changing labels Jul 2, 2024
Copy link
Member

@gavv gavv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for PR! A few comments.

src/internal_modules/roc_core/string_list.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_core/string_list.h Outdated Show resolved Hide resolved
src/internal_modules/roc_core/string_list.cpp Outdated Show resolved Hide resolved
@gavv gavv added needs revision Pull request should be revised by its author contribution A pull-request by someone else except maintainers and removed ready for review Pull request can be reviewed labels Jul 6, 2024
@github-actions github-actions bot added ready for review Pull request can be reviewed and removed needs revision Pull request should be revised by its author labels Jul 9, 2024
-Implemented a new "void pop_back()" method.
-Removes the last string from StringList.
-Returns false if deallocation fails
-Panics if StringList is empty.
-'back_' and 'front_' point to NULL when last string is poped.

Test cases covered:

-Size should be zero after removing last element from the list.
-Different size strings have been used to make sure it works as expected.
-'front_' and 'back_' have to point to same string when initial list with two strings is poped.
-'back_' should point to 'n-1' string after poping initial 'n' number of strings.
@gavv gavv added this to the next milestone Jul 11, 2024
@gavv gavv merged commit d23c0ab into roc-streaming:develop Jul 11, 2024
1 check passed
@gavv
Copy link
Member

gavv commented Jul 11, 2024

Thank you!

@github-actions github-actions bot removed the ready for review Pull request can be reviewed label Jul 11, 2024
@gavv
Copy link
Member

gavv commented Jul 11, 2024

Follow-up: use different string sizes in other tests too: 91581a0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution A pull-request by someone else except maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants