mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Replace error checks against size
with is_empty
This commit is contained in:
parent
94dbf69f5d
commit
684752e75b
58 changed files with 116 additions and 116 deletions
|
@ -901,7 +901,7 @@ Error RenderingServer::_surface_set_data(Array p_arrays, uint64_t p_format, uint
|
|||
ERR_FAIL_COND_V(p_arrays[ai].get_type() != Variant::PACKED_INT32_ARRAY, ERR_INVALID_PARAMETER);
|
||||
|
||||
Vector<int> indices = p_arrays[ai];
|
||||
ERR_FAIL_COND_V(indices.size() == 0, ERR_INVALID_PARAMETER);
|
||||
ERR_FAIL_COND_V(indices.is_empty(), ERR_INVALID_PARAMETER);
|
||||
ERR_FAIL_COND_V(indices.size() != p_index_array_len, ERR_INVALID_PARAMETER);
|
||||
|
||||
/* determine whether using 16 or 32 bits indices */
|
||||
|
@ -1326,7 +1326,7 @@ Error RenderingServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surfa
|
|||
float distance = E;
|
||||
ERR_CONTINUE(distance <= 0.0);
|
||||
Vector<int> indices = p_lods[E];
|
||||
ERR_CONTINUE(indices.size() == 0);
|
||||
ERR_CONTINUE(indices.is_empty());
|
||||
uint32_t index_count = indices.size();
|
||||
ERR_CONTINUE(index_count >= (uint32_t)index_array_len); // Should be smaller..
|
||||
|
||||
|
@ -1781,7 +1781,7 @@ Array RenderingServer::mesh_create_arrays_from_surface_data(const SurfaceData &p
|
|||
Vector<uint8_t> attrib_data = p_data.attribute_data;
|
||||
Vector<uint8_t> skin_data = p_data.skin_data;
|
||||
|
||||
ERR_FAIL_COND_V(vertex_data.size() == 0 && (p_data.format & RS::ARRAY_FORMAT_VERTEX), Array());
|
||||
ERR_FAIL_COND_V(vertex_data.is_empty() && (p_data.format & RS::ARRAY_FORMAT_VERTEX), Array());
|
||||
int vertex_len = p_data.vertex_count;
|
||||
|
||||
Vector<uint8_t> index_data = p_data.index_data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue