Skip to content

Commit 10505d7

Browse files
authored
style(clang-tidy): fix performance-unnecessary-copy-initialization (#1765)
Signed-off-by: Balakrishna Avulapati <ba@bavulapati.com>
1 parent 435c78c commit 10505d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/jsonpointer/jsonpointer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ auto set(JSON &document, const Pointer &pointer, const JSON &value) -> void {
203203

204204
JSON &current{traverse<std::allocator, JSON>(document, std::cbegin(pointer),
205205
std::prev(std::cend(pointer)))};
206-
const auto last{pointer.back()};
206+
const auto &last{pointer.back()};
207207
// Handle the hyphen as a last constant
208208
// If the currently referenced value is a JSON array, the reference
209209
// token [can be ] the single character "-", making the new referenced value
@@ -230,7 +230,7 @@ auto set(JSON &document, const Pointer &pointer, JSON &&value) -> void {
230230

231231
JSON &current{traverse<std::allocator, JSON>(document, std::cbegin(pointer),
232232
std::prev(std::cend(pointer)))};
233-
const auto last{pointer.back()};
233+
const auto &last{pointer.back()};
234234
// Handle the hyphen as a last constant
235235
// If the currently referenced value is a JSON array, the reference
236236
// token [can be ] the single character "-", making the new referenced value

0 commit comments

Comments
 (0)