Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-blobcode
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-blobcode
Commits
5cae714f
Commit
5cae714f
authored
Apr 07, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid copying for enc == dec if we can
Patch from Nils Goroll
parent
29156901
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
vmod_blobcode.c
src/vmod_blobcode.c
+14
-2
No files found.
src/vmod_blobcode.c
View file @
5cae714f
...
...
@@ -572,9 +572,21 @@ transcode(VRT_CTX, VCL_INT n, VCL_ENUM decs, VCL_ENUM encs,
/*
* If the encoding and decoding are the same, and the decoding was
* legal, just return the concatenated string.
* legal, just return the string, if there was only one in the
* STRING_LIST, or else the concatenated string.
*/
if
(
n
==
-
1
&&
enc
==
dec
)
{
const
char
*
q
,
*
pp
=
p
;
va_copy
(
aq
,
ap
);
q
=
find_nonempty_va
(
&
pp
,
ap
);
va_end
(
aq
);
if
(
pp
==
vrt_magic_string_end
)
return
""
;
if
(
q
==
vrt_magic_string_end
)
return
pp
;
r
=
VRT_String
(
ctx
->
ws
,
NULL
,
p
,
ap
);
return
r
;
}
...
...
@@ -598,7 +610,7 @@ vmod_transcode(VRT_CTX, VCL_ENUM decs, VCL_ENUM encs,
VCL_STRING
__match_proto__
(
td_blobcode_transcode_n
)
vmod_transcode_n
(
VRT_CTX
,
VCL_INT
n
,
VCL_ENUM
decs
,
VCL_ENUM
encs
,
const
char
*
p
,
...)
{
const
char
*
p
,
...)
{
va_list
ap
;
VCL_STRING
r
;
...
...
Write
Preview
Markdown
is supported
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