-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
x.json2.decoder2: use Linked List data structure strategy #22581
Conversation
Please solve the conflict, by rebasing on master or merging. |
a7eb134
to
46997be
Compare
Thank you. |
`n` { .null } | ||
else { .unknown } | ||
fn get_value_kind(value u8) ValueKind { | ||
// value := *val |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this comment, it is useless
mut result_buffer := []u8{} | ||
mut current := list.head | ||
for current != unsafe { nil } { | ||
value_kind_as_string := current.value.value_kind.str() | ||
unsafe { result_buffer.push_many(value_kind_as_string.str, value_kind_as_string.len) } | ||
result_buffer << u8(` `) | ||
|
||
current = current.next | ||
} | ||
return result_buffer.bytestr() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a string builder, not a private implementation of it, that will be harder to understand in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think buffer less complex than strings builder and not needs import strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work.
changes
Benchmarks