summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
Diffstat (limited to 'core/io')
-rw-r--r--core/io/marshalls.cpp6
-rw-r--r--core/io/resource_format_binary.cpp18
-rw-r--r--core/io/stream_peer.cpp4
3 files changed, 11 insertions, 17 deletions
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index 17a3f52a65..dc5581ea01 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -558,8 +558,6 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
w[i] = buf[i];
}
-
- w = PoolVector<uint8_t>::Write();
}
r_variant = data;
@@ -590,8 +588,6 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
w[i] = decode_uint32(&buf[i * 4]);
}
-
- w = PoolVector<int>::Write();
}
r_variant = Variant(data);
if (r_len) {
@@ -618,8 +614,6 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
w[i] = decode_float(&buf[i * 4]);
}
-
- w = PoolVector<float>::Write();
}
r_variant = data;
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 688dfc21e5..861e34e415 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -410,7 +410,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
PoolVector<uint8_t>::Write w = array.write();
f->get_buffer(w.ptr(), len);
_advance_padding(len);
- w = PoolVector<uint8_t>::Write();
+ w.release();
r_v = array;
} break;
@@ -432,7 +432,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
}
#endif
- w = PoolVector<int>::Write();
+ w.release();
r_v = array;
} break;
case VARIANT_REAL_ARRAY: {
@@ -454,7 +454,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
#endif
- w = PoolVector<real_t>::Write();
+ w.release();
r_v = array;
} break;
case VARIANT_STRING_ARRAY: {
@@ -465,7 +465,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
PoolVector<String>::Write w = array.write();
for (uint32_t i = 0; i < len; i++)
w[i] = get_unicode_string();
- w = PoolVector<String>::Write();
+ w.release();
r_v = array;
} break;
@@ -493,7 +493,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
ERR_EXPLAIN("Vector2 size is NOT 8!");
ERR_FAIL_V(ERR_UNAVAILABLE);
}
- w = PoolVector<Vector2>::Write();
+ w.release();
r_v = array;
} break;
@@ -521,7 +521,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
ERR_EXPLAIN("Vector3 size is NOT 12!");
ERR_FAIL_V(ERR_UNAVAILABLE);
}
- w = PoolVector<Vector3>::Write();
+ w.release();
r_v = array;
} break;
@@ -549,7 +549,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
ERR_EXPLAIN("Color size is NOT 16!");
ERR_FAIL_V(ERR_UNAVAILABLE);
}
- w = PoolVector<Color>::Write();
+ w.release();
r_v = array;
} break;
#ifndef DISABLE_DEPRECATED
@@ -584,7 +584,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
PoolVector<uint8_t>::Write w = imgdata.write();
f->get_buffer(w.ptr(), datalen);
_advance_padding(datalen);
- w = PoolVector<uint8_t>::Write();
+ w.release();
Ref<Image> image;
image.instance();
@@ -597,7 +597,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
data.resize(f->get_32());
PoolVector<uint8_t>::Write w = data.write();
f->get_buffer(w.ptr(), data.size());
- w = PoolVector<uint8_t>::Write();
+ w.release();
Ref<Image> image;
diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp
index 6ad24a5f3a..acf72dbba5 100644
--- a/core/io/stream_peer.cpp
+++ b/core/io/stream_peer.cpp
@@ -79,7 +79,7 @@ Array StreamPeer::_get_data(int p_bytes) {
PoolVector<uint8_t>::Write w = data.write();
Error err = get_data(&w[0], p_bytes);
- w = PoolVector<uint8_t>::Write();
+ w.release();
ret.push_back(err);
ret.push_back(data);
return ret;
@@ -101,7 +101,7 @@ Array StreamPeer::_get_partial_data(int p_bytes) {
PoolVector<uint8_t>::Write w = data.write();
int received;
Error err = get_partial_data(&w[0], p_bytes, received);
- w = PoolVector<uint8_t>::Write();
+ w.release();
if (err != OK) {
data.resize(0);