]> git.lyx.org Git - lyx.git/commitdiff
Avoid an unnecessary string copy
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 11 Sep 2024 15:08:45 +0000 (17:08 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 11 Sep 2024 15:08:45 +0000 (17:08 +0200)
Spotted by Coverity scan.

src/LyXVC.cpp

index 7e7e770b10791fc9eae0c526f1c35d1db33619e3..916ba60ac743a82dfb9dac83da890b42e59d3034 100644 (file)
@@ -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);