Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
04c6579f
Commit
04c6579f
authored
Oct 11, 2019
by
qarmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use in some functions empty PoolByteArrays
parent
aad4d864
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
variant_call.cpp
core/variant_call.cpp
+13
-8
No files found.
core/variant_call.cpp
View file @
04c6579f
...
...
@@ -553,7 +553,7 @@ struct _VariantCall {
PoolByteArray
*
ba
=
reinterpret_cast
<
PoolByteArray
*>
(
p_self
.
_data
.
_mem
);
String
s
;
if
(
ba
->
size
()
>
=
0
)
{
if
(
ba
->
size
()
>
0
)
{
PoolByteArray
::
Read
r
=
ba
->
read
();
CharString
cs
;
cs
.
resize
(
ba
->
size
()
+
1
);
...
...
@@ -569,7 +569,7 @@ struct _VariantCall {
PoolByteArray
*
ba
=
reinterpret_cast
<
PoolByteArray
*>
(
p_self
.
_data
.
_mem
);
String
s
;
if
(
ba
->
size
()
>
=
0
)
{
if
(
ba
->
size
()
>
0
)
{
PoolByteArray
::
Read
r
=
ba
->
read
();
s
.
parse_utf8
((
const
char
*
)
r
.
ptr
(),
ba
->
size
());
}
...
...
@@ -580,14 +580,15 @@ struct _VariantCall {
PoolByteArray
*
ba
=
reinterpret_cast
<
PoolByteArray
*>
(
p_self
.
_data
.
_mem
);
PoolByteArray
compressed
;
Compression
::
Mode
mode
=
(
Compression
::
Mode
)(
int
)(
*
p_args
[
0
]);
if
(
ba
->
size
()
>
0
)
{
Compression
::
Mode
mode
=
(
Compression
::
Mode
)(
int
)(
*
p_args
[
0
]);
compressed
.
resize
(
Compression
::
get_max_compressed_buffer_size
(
ba
->
size
(),
mode
));
int
result
=
Compression
::
compress
(
compressed
.
write
().
ptr
(),
ba
->
read
().
ptr
(),
ba
->
size
(),
mode
);
result
=
result
>=
0
?
result
:
0
;
compressed
.
resize
(
result
);
compressed
.
resize
(
Compression
::
get_max_compressed_buffer_size
(
ba
->
size
(),
mode
));
int
result
=
Compression
::
compress
(
compressed
.
write
().
ptr
(),
ba
->
read
().
ptr
(),
ba
->
size
(),
mode
);
result
=
result
>=
0
?
result
:
0
;
compressed
.
resize
(
result
);
}
r_ret
=
compressed
;
}
...
...
@@ -615,6 +616,10 @@ struct _VariantCall {
static
void
_call_PoolByteArray_hex_encode
(
Variant
&
r_ret
,
Variant
&
p_self
,
const
Variant
**
p_args
)
{
PoolByteArray
*
ba
=
reinterpret_cast
<
PoolByteArray
*>
(
p_self
.
_data
.
_mem
);
if
(
ba
->
size
()
==
0
)
{
r_ret
=
String
();
return
;
}
PoolByteArray
::
Read
r
=
ba
->
read
();
String
s
=
String
::
hex_encode_buffer
(
&
r
[
0
],
ba
->
size
());
r_ret
=
s
;
...
...
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