mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
C#: Remove false positives for cs/useless-assignment-to-local
This commit is contained in:
@@ -114,7 +114,7 @@ class RelevantDefinition extends AssignableDefinition {
|
||||
*/
|
||||
private predicate isDefaultLikeInitializer() {
|
||||
this.isInitializer() and
|
||||
exists(Expr e | e = this.getSource() |
|
||||
exists(Expr e | e = this.getSource().stripCasts() |
|
||||
exists(string val | val = e.getValue() |
|
||||
val = "0" or
|
||||
val = "-1" or
|
||||
|
||||
Reference in New Issue
Block a user