Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
jsonrpsee
Commits
a76d72f3
Unverified
Commit
a76d72f3
authored
Jun 30, 2022
by
Niklas Adolfsson
Browse files
pre-allocate string for batches
parent
dbd30e28
Pipeline
#200992
passed with stages
in 5 minutes and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
core/src/server/helpers.rs
View file @
a76d72f3
...
...
@@ -271,7 +271,10 @@ pub struct BatchResponseBuilder {
impl
BatchResponseBuilder
{
/// Create a new batch response builder with limit.
pub
fn
new_with_limit
(
limit
:
usize
)
->
Self
{
Self
{
result
:
String
::
from
(
"["
),
max_response_size
:
limit
}
let
mut
initial
=
String
::
with_capacity
(
2048
);
initial
.push
(
'['
);
Self
{
result
:
initial
,
max_response_size
:
limit
}
}
/// Append a result from an individual method to the batch response.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment