You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by se...@apache.org on 2022/10/29 07:51:54 UTC

[incubator-brpc] branch master updated: avoid std::string copy (#1969)

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 <12...@users.noreply.github.com>
AuthorDate: Sat Oct 29 15:51:44 2022 +0800

    avoid std::string copy (#1969)
    
    * avoid std::string copy
    
    * fix  format
    
    Co-authored-by: sven <we...@genew.com>
---
 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: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org