Skip to content

Commit

Permalink
avoid std::string copy (#1969)
Browse files Browse the repository at this point in the history
* avoid std::string copy

* fix  format

Co-authored-by: sven <weiguodong@genew.com>
  • Loading branch information
ml-haha and sven authored Oct 29, 2022
1 parent bd097ca commit 0b5b72f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bvar/mvariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ size_t MVariable::dump_exposed(Dumper* dumper, const DumpOptions* options) {
std::vector<std::string> mvars;
list_exposed(&mvars);
size_t n = 0;
for (auto mvar : mvars) {
for (auto& mvar : mvars) {
MVarMapWithLock& m = get_mvar_map();
BAIDU_SCOPED_LOCK(m.mutex);
MVarEntry* entry = m.seek(mvar);
Expand Down

0 comments on commit 0b5b72f

Please sign in to comment.