Skip to content

Commit a9cf9fa

Browse files
authored
Fix debug build on OSX (#33)
Closes #32. Fixes iteration of tokens on OSX.
1 parent 2a7cb61 commit a9cf9fa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

include/qasm/AST/ASTBase.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,10 @@ class ASTTokenFactory {
201201
}
202202

203203
static const ASTToken *GetPreviousToken() {
204-
std::map<uint32_t, ASTToken *>::const_reverse_iterator MRI = TFM.rbegin();
205-
if (MRI == TFM.rend())
204+
if (TFM.empty())
206205
return nullptr;
207206

208-
--MRI;
209-
return MRI == TFM.rend() ? nullptr : (*MRI).second;
207+
return std::prev(TFM.end())->second;
210208
}
211209

212210
static uint32_t GetCurrentIndex() { return TIX; }

0 commit comments

Comments
 (0)