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

chore: improve the state machine of RedisParser #4085

Merged
merged 1 commit into from
Nov 15, 2024
Merged

chore: improve the state machine of RedisParser #4085

merged 1 commit into from
Nov 15, 2024

Conversation

romange
Copy link
Collaborator

@romange romange commented Nov 7, 2024

  1. Simplify conditions inside the main loop.
  2. Improve the logic inside ConsumeBulk() function.

@@ -110,16 +110,16 @@ TEST_F(RedisParserTest, Multi2) {
EXPECT_EQ(4, consumed_);

ASSERT_EQ(RedisParser::INPUT_PENDING, Parse("$4\r\nMSET"));
EXPECT_EQ(4, consumed_);
EXPECT_EQ(8, consumed_);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

now we consume the bulk string token even if we have not parsed '\r\n' fully.

1. Simplify conditions inside the main loop.
2. Improve the logic inside ConsumeBulk() function.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
@romange romange merged commit 2ff6bf3 into main Nov 15, 2024
17 checks passed
@romange romange deleted the Pr4 branch November 15, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants