MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / deletePrevious

Method deletePrevious

lib/token.cpp:292–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292void Token::deletePrevious(nonneg int count)
293{
294 while (mPrevious && count > 0) {
295 Token *p = mPrevious;
296
297 // #8154 we are about to be unknown -> destroy the link to us
298 if (p->mLink && p->mLink->mLink == p)
299 p->mLink->link(nullptr);
300
301 mPrevious = p->previous();
302 delete p;
303 --count;
304 }
305
306 if (mPrevious)
307 mPrevious->next(this);
308 else
309 mTokensFrontBack->front = this;
310}
311
312void Token::swapWithNext()
313{

Callers 8

deleteTokenMethod · 0.80
createTokensMethod · 0.80
replaceMethod · 0.80
simplifyTypedefCppMethod · 0.80
simplifyUsingMethod · 0.80
simplifyOperatorNameMethod · 0.80
deleteFirstMethod · 0.80

Calls 1

nextMethod · 0.80

Tested by 1

deleteFirstMethod · 0.64