[LyX/master] A few more constants to avoid copies

Thibaut Cuvelier tcuvelier at lyx.org
Sat Sep 19 18:18:55 UTC 2020


commit 9184ae14f0e1925cc6c63b046a65157c08d65159
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Sun Aug 16 19:07:14 2020 +0200

    A few more constants to avoid copies
---
 src/insets/InsetBibtex.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp
index 876adea..34b22c1 100644
--- a/src/insets/InsetBibtex.cpp
+++ b/src/insets/InsetBibtex.cpp
@@ -1216,9 +1216,9 @@ void InsetBibtex::docbook(XMLStream & xs, OutputParams const &) const
 		if (! delayedTags.empty()) {
 			unsigned long remainingTags = delayedTags.size(); // Used as a workaround. With GCC 7, when erasing all
 			// elements one by one, some elements may still pop in later on (even though they were deleted previously).
-			auto hasTag = [&delayedTags](string key) { return delayedTags.find(key) != delayedTags.end(); };
-			auto getTag = [&delayedTags](string key) { return from_utf8(delayedTags[key]); };
-			auto eraseTag = [&delayedTags, &remainingTags](string key) {
+			auto hasTag = [&delayedTags](const string & key) { return delayedTags.find(key) != delayedTags.end(); };
+			auto getTag = [&delayedTags](const string & key) { return from_utf8(delayedTags[key]); };
+			auto eraseTag = [&delayedTags, &remainingTags](const string & key) {
 				remainingTags -= 1;
 				delayedTags.erase(key);
 			};


More information about the lyx-cvs mailing list