summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AK/Vector.h4
-rw-r--r--Kernel/FileSystem/VirtualFileSystem.cpp2
-rw-r--r--Kernel/Process.cpp2
-rw-r--r--Kernel/SharedBuffer.cpp2
4 files changed, 5 insertions, 5 deletions
diff --git a/AK/Vector.h b/AK/Vector.h
index eb31c6282b..9d525c80cc 100644
--- a/AK/Vector.h
+++ b/AK/Vector.h
@@ -310,11 +310,11 @@ public:
return value;
}
- void unstable_remove(size_t index)
+ T unstable_take(size_t index)
{
ASSERT(index < m_size);
swap(at(index), at(m_size - 1));
- take_last();
+ return take_last();
}
void remove(size_t index)
diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp
index 561dd36c0a..681607515c 100644
--- a/Kernel/FileSystem/VirtualFileSystem.cpp
+++ b/Kernel/FileSystem/VirtualFileSystem.cpp
@@ -119,7 +119,7 @@ KResult VFS::unmount(Inode& guest_inode)
return result;
}
dbg() << "VFS: found fs " << mount.guest_fs().fsid() << " at mount index " << i << "! Unmounting...";
- m_mounts.unstable_remove(i);
+ m_mounts.unstable_take(i);
return KSuccess;
}
}
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index ed4c571fde..6fa34e1170 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -237,7 +237,7 @@ bool Process::deallocate_region(Region& region)
m_region_lookup_cache.region = nullptr;
for (size_t i = 0; i < m_regions.size(); ++i) {
if (&m_regions[i] == &region) {
- m_regions.unstable_remove(i);
+ m_regions.unstable_take(i);
return true;
}
}
diff --git a/Kernel/SharedBuffer.cpp b/Kernel/SharedBuffer.cpp
index 9ac656e4f0..c87fb705c6 100644
--- a/Kernel/SharedBuffer.cpp
+++ b/Kernel/SharedBuffer.cpp
@@ -156,7 +156,7 @@ void SharedBuffer::disown(pid_t pid)
dbg() << "Disowning shared buffer " << m_shbuf_id << " of size " << size() << " by PID " << pid;
#endif
m_total_refs -= ref.count;
- m_refs.unstable_remove(i);
+ m_refs.unstable_take(i);
#ifdef SHARED_BUFFER_DEBUG
dbg() << "Disowned shared buffer " << m_shbuf_id << " of size " << size() << " by PID " << pid;
#endif