Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unbound Args::shift function #2342

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/natalie/args.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class Args {

Args &operator=(const Args &other);

static Args shift(const Args &args);
Value shift();

Value operator[](size_t index) const;
Expand Down
8 changes: 0 additions & 8 deletions src/args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ Args &Args::operator=(const Args &other) {
return *this;
}

Args Args::shift(const Args &args) {
assert(args.size() > 0);
if (args.size() == 1)
return Args();
auto ary = new ArrayObject(args.size() - 1, args.data() + 1);
return Args(ary, args.has_keyword_hash());
}

Value Args::shift() {
assert(m_data.size() > 0);
return m_data.pop_front();
Expand Down
Loading