mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
Shell: Store ListValue's values in a NonnullRefPtrVector<Value>
A ListValue never stores null Values, so it makes sense to restrict it. This also propagates use of NonnullRefPtr to the create() helpers. There's a small bit of awkwardness around the use of initializer_list, since we cannot directly construct a NonnullRefPtrVector from one.
This commit is contained in:
parent
08e5371f44
commit
420e809fee
3 changed files with 16 additions and 16 deletions
|
@ -664,7 +664,7 @@ int Shell::builtin_shift(int argc, const char** argv)
|
|||
}
|
||||
|
||||
if (!argv_->is_list())
|
||||
argv_ = adopt(*new AST::ListValue({ argv_ }));
|
||||
argv_ = adopt(*new AST::ListValue({ argv_.release_nonnull() }));
|
||||
|
||||
auto& values = static_cast<AST::ListValue*>(argv_.ptr())->values();
|
||||
if ((size_t)count > values.size()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue