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

Feature/faster parsing #26

Merged
merged 4 commits into from
Dec 27, 2021
Merged

Conversation

chrisputnam9
Copy link
Contributor

Here is the faster parsing feature.

This is a branch off of test/large-json-parse-slow so those tests are included

See #24

@@ -5,7 +5,8 @@
class HJSONParser
{

private $text;
private $text_array;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wrong coding style. It should be $textArray.


// Mimic old behavior with mb_substr
if ($i >= $this->text_length_chars)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wrong coding style. It should be if ($i >= $this->text_length_chars) {.

$index = $this->at + $offs;

// Mimic old behavior with mb_substr
if ($index < 0) $index = 0;
Copy link
Collaborator

@peter279k peter279k Nov 27, 2020

Choose a reason for hiding this comment

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

Wrong coding style. It should be:

if ($index < 0) {
    $index = 0;
}

@trobro trobro self-requested a review December 27, 2021 16:38
Copy link
Member

@trobro trobro left a comment

Choose a reason for hiding this comment

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

Nice improvement! Sorry for not reviewing sooner.

@trobro trobro merged commit 7aaa80f into hjson:master Dec 27, 2021
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.

3 participants