From 6fe4894c70ce74439a806eb51698972df258c59d Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Tue, 22 Sep 2020 11:02:41 +0200 Subject: [PATCH] removed unnecessary extra initialisation --- interpreter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/interpreter.cpp b/interpreter.cpp index bd3db0e..aa91e31 100644 --- a/interpreter.cpp +++ b/interpreter.cpp @@ -33,7 +33,7 @@ std::string interpreter::eval(std::istream& in, bool& done) { reset(); done = false; - // first pass: read program & resolve labels + // first pass: read program & resolve labels, ignore comments for (std::string line; std::getline(in, line);) { if (line[0] == ':') { // check label definition _labels.emplace(line.substr(1), _prog.size()); @@ -46,7 +46,6 @@ std::string interpreter::eval(std::istream& in, bool& done) { } // second pass: run program - _pc = 0; while (_pc < _prog.size() && !done) { // fetch next instruction std::string code {_prog[_pc]};