This is an automated email from the ASF dual-hosted git repository.

serverglen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 0b5b72fc avoid std::string copy (#1969)
0b5b72fc is described below

commit 0b5b72fc32fe12f5246be4ee84cb3eae922da275
Author: junyao <[email protected]>
AuthorDate: Sat Oct 29 15:51:44 2022 +0800

    avoid std::string copy (#1969)
    
    * avoid std::string copy
    
    * fix  format
    
    Co-authored-by: sven <[email protected]>
---
 src/bvar/mvariable.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bvar/mvariable.cpp b/src/bvar/mvariable.cpp
index a2ad94b0..29caddff 100644
--- a/src/bvar/mvariable.cpp
+++ b/src/bvar/mvariable.cpp
@@ -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);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to