Parcourir la source

[2369] Initialize buffer_pos_ with 0

This is equivalent code to the former. The former was written such to
drive the point that buffer_pos_ is by default pointing at the end of
the buffer_ vector.  At construction, the buffer_ vector is empty, so
both work.
Mukund Sivaraman il y a 12 ans
Parent
commit
710bac3516
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/lib/dns/master_lexer_inputsource.cc

+ 2 - 2
src/lib/dns/master_lexer_inputsource.cc

@@ -33,7 +33,7 @@ InputSource::InputSource(std::istream& input_stream) :
     at_eof_(false),
     line_(1),
     saved_line_(line_),
-    buffer_pos_(buffer_.size()),
+    buffer_pos_(0),
     name_(createStreamName(input_stream)),
     input_(input_stream)
 {}
@@ -42,7 +42,7 @@ InputSource::InputSource(const char* filename) :
     at_eof_(false),
     line_(1),
     saved_line_(line_),
-    buffer_pos_(buffer_.size()),
+    buffer_pos_(0),
     name_(filename),
     input_(file_stream_)
 {