removed unnecessary extra initialisation

This commit is contained in:
Bob Polis 2020-09-22 11:02:41 +02:00
parent 184cab5205
commit 6fe4894c70

View File

@ -33,7 +33,7 @@ std::string interpreter::eval(std::istream& in, bool& done) {
reset(); reset();
done = false; done = false;
// first pass: read program & resolve labels // first pass: read program & resolve labels, ignore comments
for (std::string line; std::getline(in, line);) { for (std::string line; std::getline(in, line);) {
if (line[0] == ':') { // check label definition if (line[0] == ':') { // check label definition
_labels.emplace(line.substr(1), _prog.size()); _labels.emplace(line.substr(1), _prog.size());
@ -46,7 +46,6 @@ std::string interpreter::eval(std::istream& in, bool& done) {
} }
// second pass: run program // second pass: run program
_pc = 0;
while (_pc < _prog.size() && !done) { while (_pc < _prog.size() && !done) {
// fetch next instruction // fetch next instruction
std::string code {_prog[_pc]}; std::string code {_prog[_pc]};