From 851e59cd2657a73a5fd376d01ce2d1dfc336fe23 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 11 Sep 2024 17:08:45 +0200 Subject: [PATCH] Avoid an unnecessary string copy Spotted by Coverity scan. --- src/LyXVC.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/LyXVC.cpp b/src/LyXVC.cpp index 7e7e770b10..916ba60ac7 100644 --- a/src/LyXVC.cpp +++ b/src/LyXVC.cpp @@ -245,14 +245,13 @@ LyXVC::CommandResult LyXVC::checkIn(string & log) LYXERR(Debug::LYXVC, "LyXVC: checkIn"); if (!vcs_) return ErrorBefore; - docstring empty(_("(no log message)")); docstring response; bool ok = true; if (vcs_->isCheckInWithConfirmation()) ok = Alert::askForText(response, _("LyX VC: Log Message")); if (ok) { if (response.empty()) - response = empty; + response = _("(no log message)"); //shell collisions response = subst(response, from_ascii("\""), from_ascii("\\\"")); return vcs_->checkIn(to_utf8(response), log);