summaryrefslogtreecommitdiff
path: root/Userland/DevTools/Profiler/Profile.h
diff options
context:
space:
mode:
authorHendiadyoin1 <leon2002.la@gmail.com>2021-12-22 16:51:04 +0100
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-12-23 12:45:36 -0800
commit071d72b49433be1d8d400d0c70b0aae680096638 (patch)
treecadf59d2bbdfd8fd34317a0dc9c5d0f8cd0006a5 /Userland/DevTools/Profiler/Profile.h
parente3469391d3eda3e335189ba021edddd76ec0fd59 (diff)
downloadserenity-071d72b49433be1d8d400d0c70b0aae680096638.zip
Profiler: Always use FlyString const&'s in ProfileNode construction
No need to copy and move them around, just to pass them as a `String const&` to the constructor. We still end up copying it to a normal String in the end though...
Diffstat (limited to 'Userland/DevTools/Profiler/Profile.h')
-rw-r--r--Userland/DevTools/Profiler/Profile.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/DevTools/Profiler/Profile.h b/Userland/DevTools/Profiler/Profile.h
index 876a044248..e153a9bc70 100644
--- a/Userland/DevTools/Profiler/Profile.h
+++ b/Userland/DevTools/Profiler/Profile.h
@@ -32,9 +32,9 @@ extern OwnPtr<Debug::DebugInfo> g_kernel_debug_info;
class ProfileNode : public RefCounted<ProfileNode> {
public:
- static NonnullRefPtr<ProfileNode> create(Process const& process, FlyString object_name, String symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid)
+ static NonnullRefPtr<ProfileNode> create(Process const& process, FlyString const& object_name, String symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid)
{
- return adopt_ref(*new ProfileNode(process, move(object_name), move(symbol), address, offset, timestamp, pid));
+ return adopt_ref(*new ProfileNode(process, object_name, move(symbol), address, offset, timestamp, pid));
}
static NonnullRefPtr<ProfileNode> create_process_node(Process const& process)
@@ -72,7 +72,7 @@ public:
m_children.append(child);
}
- ProfileNode& find_or_create_child(FlyString object_name, String symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid)
+ ProfileNode& find_or_create_child(FlyString const& object_name, String symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t pid)
{
for (size_t i = 0; i < m_children.size(); ++i) {
auto& child = m_children[i];
@@ -80,7 +80,7 @@ public:
return child;
}
}
- auto new_child = ProfileNode::create(m_process, move(object_name), move(symbol), address, offset, timestamp, pid);
+ auto new_child = ProfileNode::create(m_process, object_name, move(symbol), address, offset, timestamp, pid);
add_child(new_child);
return new_child;
};
@@ -110,7 +110,7 @@ public:
private:
explicit ProfileNode(Process const&);
- explicit ProfileNode(Process const&, const String& object_name, String symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t);
+ explicit ProfileNode(Process const&, FlyString const& object_name, String symbol, FlatPtr address, u32 offset, u64 timestamp, pid_t);
bool m_root { false };
Process const& m_process;