diff options
author | Neil <nyamatongwe@gmail.com> | 2020-03-31 08:15:54 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2020-03-31 08:15:54 +1100 |
commit | 91ecae0a4522b34ced2ac667d4efca0bdb449827 (patch) | |
tree | 9c370e0f5421522920f2d6738118d930c1cff3b0 /src/Document.cxx | |
parent | 30748b957f1fbce6c79c7ac48e8b377cd6c7fd5a (diff) | |
download | scintilla-mirror-91ecae0a4522b34ced2ac667d4efca0bdb449827.tar.gz |
Pass argument as unique_ptr to show transfer of ownership. Add const and noexcept.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 2c2d86de6..6b93a30af 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -2262,12 +2262,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<LexInterface> pLexInterface) noexcept { + pli = std::move(pLexInterface); } int SCI_METHOD Document::SetLineState(Sci_Position line, int state) { |