mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:57:44 +00:00
AK: Rename adopt() to adopt_ref()
This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
This commit is contained in:
parent
b3db01e20e
commit
b91c49364d
228 changed files with 461 additions and 461 deletions
|
@ -24,13 +24,13 @@ namespace Shell::AST {
|
|||
template<typename T, typename... Args>
|
||||
static inline NonnullRefPtr<T> create(Args... args)
|
||||
{
|
||||
return adopt(*new T(args...));
|
||||
return adopt_ref(*new T(args...));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static inline NonnullRefPtr<T> create(std::initializer_list<NonnullRefPtr<Value>> arg)
|
||||
{
|
||||
return adopt(*new T(arg));
|
||||
return adopt_ref(*new T(arg));
|
||||
}
|
||||
|
||||
struct HighlightMetadata {
|
||||
|
@ -122,7 +122,7 @@ struct PathRedirection : public Redirection {
|
|||
|
||||
static NonnullRefPtr<PathRedirection> create(String path, int fd, decltype(direction) direction)
|
||||
{
|
||||
return adopt(*new PathRedirection(move(path), fd, direction));
|
||||
return adopt_ref(*new PathRedirection(move(path), fd, direction));
|
||||
}
|
||||
|
||||
virtual Result<NonnullRefPtr<Rewiring>, String> apply() const override;
|
||||
|
@ -143,19 +143,19 @@ struct FdRedirection : public Redirection {
|
|||
public:
|
||||
static NonnullRefPtr<FdRedirection> create(int old_fd, int new_fd, Rewiring::Close close)
|
||||
{
|
||||
return adopt(*new FdRedirection(old_fd, new_fd, close));
|
||||
return adopt_ref(*new FdRedirection(old_fd, new_fd, close));
|
||||
}
|
||||
|
||||
static NonnullRefPtr<FdRedirection> create(int old_fd, int new_fd, FdRedirection* pipe_end, Rewiring::Close close)
|
||||
{
|
||||
return adopt(*new FdRedirection(old_fd, new_fd, pipe_end, close));
|
||||
return adopt_ref(*new FdRedirection(old_fd, new_fd, pipe_end, close));
|
||||
}
|
||||
|
||||
virtual ~FdRedirection();
|
||||
|
||||
virtual Result<NonnullRefPtr<Rewiring>, String> apply() const override
|
||||
{
|
||||
return adopt(*new Rewiring(old_fd, new_fd, other_pipe_end, action));
|
||||
return adopt_ref(*new Rewiring(old_fd, new_fd, other_pipe_end, action));
|
||||
}
|
||||
|
||||
int old_fd { -1 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue