[PATCH] D116318: [clang-format][NFC] Fix a bug in getPreviousToken() in the parser

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 28 13:44:06 PST 2021


owenpan added a comment.

In D116318#3211689 <https://reviews.llvm.org/D116318#3211689>, @HazardyKnusperkeks wrote:

> I'm against that patch.
>
>> Don't pay for what you don't use.
>
> We should not put the size check into every call.

That's what you must do now **without **this patch, which will fix the problem. I should be able to just call `getPreviousToken()` without having to first check `Position > 0`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116318/new/

https://reviews.llvm.org/D116318



More information about the cfe-commits mailing list