Skip to content

Commit

Permalink
Fixed Var::resize() when var was undefined, it only converted to array
Browse files Browse the repository at this point in the history
  • Loading branch information
aslze committed May 12, 2024
1 parent 26f7bd6 commit 073d576
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/asl/Var.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,13 @@ class ASL_API Var
Var& operator<<(const T& x) {return (*this) << (Var)x;}
/** Adds keys and values from v to this var if it is an object, overwriting existing keys */
Var& extend(const Var& v);
/** Resizes this var to `n` elements if this var is an array, converting if was NONE */
/** Resizes this var to `n` elements if this var is an array, converting if it was NONE */
void resize(int n)
{
if(_type==NONE) {
_type=ARRAY;
NEW_ARRAY(_a);
_a->resize(n);
}
else if(_type==ARRAY)
_a->resize(n);
Expand Down

0 comments on commit 073d576

Please sign in to comment.