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

Pass number instead of string into Buffer.indexOf #88

Merged
merged 1 commit into from
Oct 28, 2020
Merged

Pass number instead of string into Buffer.indexOf #88

merged 1 commit into from
Oct 28, 2020

Conversation

gkjohnson
Copy link
Contributor

Fix #87

@@ -27,8 +28,10 @@ export function extractFields(buffer: Buffer) {
throw new Error("Header fields are corrupt.");
}

// Passing a number into "indexOf" explicitly to avoid Buffer polyfill
// slow path. See issue #87.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 great comment to help remember why the code is the way it is.

@brianc brianc merged commit 182ac62 into cruise-automation:master Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

"extractFields" function triggers Buffer.indexOf polyfill slow path
2 participants