Skip to content

Commit e72761a

Browse files
bnoordhuisMylesBorins
authored andcommitted
src: return references from getters, not copies
PR-URL: #15458 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent aded597 commit e72761a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/node_perf.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ class PerformanceEntry : public BaseObject {
7070
return env_;
7171
}
7272

73-
std::string name() const {
73+
const std::string& name() const {
7474
return name_;
7575
}
7676

77-
std::string type() const {
77+
const std::string& type() const {
7878
return type_;
7979
}
8080

@@ -132,11 +132,11 @@ class PerformanceEntry : public BaseObject {
132132

133133
~PerformanceEntry() {}
134134

135-
std::string name() const {
135+
const std::string& name() const {
136136
return name_;
137137
}
138138

139-
std::string type() const {
139+
const std::string& type() const {
140140
return type_;
141141
}
142142

0 commit comments

Comments
 (0)