mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Smoke test: In collections, log an error if reserve() is called with a number smaller than the current size. Don't log an error if it is called with a number smaller than the current capacity.
This commit is contained in:
parent
1696ab0cb6
commit
7c37188ca1
7 changed files with 16 additions and 13 deletions
|
|
@ -260,7 +260,6 @@ int64_t AStar3D::get_point_capacity() const {
|
|||
|
||||
void AStar3D::reserve_space(int64_t p_num_nodes) {
|
||||
ERR_FAIL_COND_MSG(p_num_nodes <= 0, vformat("New capacity must be greater than 0, new was: %d.", p_num_nodes));
|
||||
ERR_FAIL_COND_MSG((uint32_t)p_num_nodes < points.get_capacity(), vformat("New capacity must be greater than current capacity: %d, new was: %d.", points.get_capacity(), p_num_nodes));
|
||||
points.reserve(p_num_nodes);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue