mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Replace size() == 0 with is_empty().
This commit is contained in:
@@ -4335,7 +4335,7 @@ void Animation::_value_track_optimize(int p_idx, real_t p_allowed_velocity_err,
|
||||
ERR_FAIL_INDEX(p_idx, tracks.size());
|
||||
ERR_FAIL_COND(tracks[p_idx]->type != TYPE_VALUE);
|
||||
ValueTrack *vt = static_cast<ValueTrack *>(tracks[p_idx]);
|
||||
if (vt->values.size() == 0) {
|
||||
if (vt->values.is_empty()) {
|
||||
return;
|
||||
}
|
||||
Variant::Type type = vt->values[0].value.get_type();
|
||||
@@ -4582,7 +4582,7 @@ struct AnimationCompressionDataState {
|
||||
}
|
||||
|
||||
uint32_t get_temp_packet_size() const {
|
||||
if (temp_packets.size() == 0) {
|
||||
if (temp_packets.is_empty()) {
|
||||
return 0;
|
||||
} else if (temp_packets.size() == 1) {
|
||||
return components == 1 ? 4 : 8; // 1 component packet is 16 bits and 16 bits unused. 3 component packets is 48 bits and 16 bits unused
|
||||
@@ -4624,7 +4624,7 @@ struct AnimationCompressionDataState {
|
||||
}
|
||||
|
||||
void commit_temp_packets() {
|
||||
if (temp_packets.size() == 0) {
|
||||
if (temp_packets.is_empty()) {
|
||||
return; // Nothing to do.
|
||||
}
|
||||
//#define DEBUG_PACKET_PUSH
|
||||
@@ -4890,7 +4890,7 @@ void Animation::compress(uint32_t p_page_size, uint32_t p_fps, float p_split_tol
|
||||
track_bounds.push_back(bounds);
|
||||
}
|
||||
|
||||
if (tracks_to_compress.size() == 0) {
|
||||
if (tracks_to_compress.is_empty()) {
|
||||
return; //nothing to compress
|
||||
}
|
||||
|
||||
@@ -5045,7 +5045,7 @@ void Animation::compress(uint32_t p_page_size, uint32_t p_fps, float p_split_tol
|
||||
uint32_t total_page_size = 0;
|
||||
|
||||
for (uint32_t i = 0; i < data_tracks.size(); i++) {
|
||||
if (data_tracks[i].temp_packets.size() == 0 || (data_tracks[i].temp_packets[data_tracks[i].temp_packets.size() - 1].frame) < finalizer_local_frame) {
|
||||
if (data_tracks[i].temp_packets.is_empty() || (data_tracks[i].temp_packets[data_tracks[i].temp_packets.size() - 1].frame) < finalizer_local_frame) {
|
||||
// Add finalizer frame if it makes sense
|
||||
Vector3i values = _compress_key(tracks_to_compress[i], track_bounds[i], -1, page_end_frame * frame_len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user