From 8898dd74337c8fb7ac76e157f9afee38ffbe1438 Mon Sep 17 00:00:00 2001 From: mitchell Date: Sun, 5 Apr 2020 16:04:05 -0400 Subject: Backport: Pass argument as unique_ptr to show transfer of ownership. Add const and noexcept. Backport of changeset 8106:f26e186e80a9. --- src/Document.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Document.cxx') diff --git a/src/Document.cxx b/src/Document.cxx index d85b71106..6670bbdb3 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -2265,12 +2265,12 @@ void Document::LexerChanged() { } } -LexInterface *Document::GetLexInterface() const { +LexInterface *Document::GetLexInterface() const noexcept { return pli.get(); } -void Document::SetLexInterface(LexInterface *pLexInterface) { - pli.reset(pLexInterface); +void Document::SetLexInterface(std::unique_ptr pLexInterface) noexcept { + pli = std::move(pLexInterface); } int SCI_METHOD Document::SetLineState(Sci_Position line, int state) { -- cgit v1.2.3