Skip to content

Commit

Permalink
Fix debug build on OSX (#33)
Browse files Browse the repository at this point in the history
Closes #32. Fixes iteration of tokens on OSX.
  • Loading branch information
taalexander authored Mar 26, 2024
1 parent 2a7cb61 commit a9cf9fa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/qasm/AST/ASTBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,10 @@ class ASTTokenFactory {
}

static const ASTToken *GetPreviousToken() {
std::map<uint32_t, ASTToken *>::const_reverse_iterator MRI = TFM.rbegin();
if (MRI == TFM.rend())
if (TFM.empty())
return nullptr;

--MRI;
return MRI == TFM.rend() ? nullptr : (*MRI).second;
return std::prev(TFM.end())->second;
}

static uint32_t GetCurrentIndex() { return TIX; }
Expand Down

0 comments on commit a9cf9fa

Please sign in to comment.