diff options
author | Michal 'vorner' Vaner <michal.vaner@nic.cz> | 2012-11-22 11:34:48 +0100 |
---|---|---|
committer | Michal 'vorner' Vaner <michal.vaner@nic.cz> | 2012-11-22 11:34:48 +0100 |
commit | e27a2922bca6a9c9f53e867c187a6e589bf3175c (patch) | |
tree | 4b771c3d72bb59c8d414554025e5650468b623ea /src/lib | |
parent | [2375] Handle EOF after unbalanced parentheses (diff) | |
download | kea-e27a2922bca6a9c9f53e867c187a6e589bf3175c.tar.xz kea-e27a2922bca6a9c9f53e867c187a6e589bf3175c.zip |
[2375] Return a reference to the token
The copy is shallow anyway, so it wouldn't survive for long.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/dns/master_lexer.cc | 2 | ||||
-rw-r--r-- | src/lib/dns/master_lexer.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/dns/master_lexer.cc b/src/lib/dns/master_lexer.cc index d891b4b1da..17cdda8eeb 100644 --- a/src/lib/dns/master_lexer.cc +++ b/src/lib/dns/master_lexer.cc @@ -164,7 +164,7 @@ MasterLexer::getSourceLine() const { return (impl_->sources_.back()->getCurrentLine()); } -MasterLexer::Token +const MasterLexer::Token& MasterLexer::getNextToken(Options options) { // If the source is not available if (impl_->source_ == NULL) { diff --git a/src/lib/dns/master_lexer.h b/src/lib/dns/master_lexer.h index 45975fb108..598d64d79c 100644 --- a/src/lib/dns/master_lexer.h +++ b/src/lib/dns/master_lexer.h @@ -213,7 +213,7 @@ public: /// source (eg. I/O error in the file on the disk). /// \throw std::bad_alloc in case allocation of some internal resources /// or the token fail. - Token getNextToken(Options options = NONE); + const Token& getNextToken(Options options = NONE); /// \brief Return the last token back to the lexer. /// |