Add rules for tokAt(0) and strAt(0), suggested by reif

This commit is contained in:
Raphael Geissert 2011-02-02 18:57:45 -06:00
parent bacb234534
commit 2b77e3591e
1 changed files with 16 additions and 0 deletions

View File

@ -16,3 +16,19 @@
without special pattern requirements.</summary>
</message>
</rule>
<rule version="1">
<pattern>\b[\w_]+ \. tokAt \( 0 \)</pattern>
<message>
<id>TokentokAt0</id>
<severity>error</severity>
<summary>tok->tokAt(0) is a slow way to say tok.</summary>
</message>
</rule>
<rule version="1">
<pattern>\b[\w_]+ \. strAt \( 0 \)</pattern>
<message>
<id>TokenstrAt0</id>
<severity>error</severity>
<summary>tok->strAt(0) is a slow way to say tok->str()</summary>
</message>
</rule>