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

more careful timestamp retrieval #675

Merged
merged 1 commit into from
Jul 17, 2019

Conversation

ilya-mim
Copy link
Contributor

@ilya-mim ilya-mim commented Jul 4, 2019

Issue #669
It allows to retrieval lastTime value more careful when custom time label is used.

lib/proto.js Outdated
@@ -130,7 +130,8 @@ function write (_obj, msg, num) {
// it is not needed anymore
stream.lastMsg = msg
stream.lastObj = obj
stream.lastTime = t.slice(8)
const timeMatch = t.match(/\d+/)
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn’t have a regular expression in this hot path. It would be better to use .slice with a correct count.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added timeSliceIndexSym with correct count.

@@ -178,7 +178,7 @@ test('with custom timestamp', async ({ is }) => {
cb()
Copy link
Member

Choose a reason for hiding this comment

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

I’m not sure about overloading this test to test two things. I think there should be separate tests to cover both items.

Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link

github-actions bot commented Feb 4, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants