Browse Source

[2375] Return a reference to the token

The copy is shallow anyway, so it wouldn't survive for long.
Michal 'vorner' Vaner 12 years ago
parent
commit
e27a2922bc
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/lib/dns/master_lexer.cc
  2. 1 1
      src/lib/dns/master_lexer.h

+ 1 - 1
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) {

+ 1 - 1
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.
     ///