File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed
csharp/ql/test/query-tests/Useless Code/IntGetHashCode Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,16 @@ class IntGetHashCode
33 void Test ( )
44 {
55 // These are all bad:
6- default ( uint ) . GetHashCode ( ) ; // $ Alert
76 default ( int ) . GetHashCode ( ) ; // $ Alert
8- default ( long ) . GetHashCode ( ) ; // $ Alert
9- default ( ulong ) . GetHashCode ( ) ; // $ Alert
107 default ( short ) . GetHashCode ( ) ; // $ Alert
118 default ( ushort ) . GetHashCode ( ) ; // $ Alert
129 default ( byte ) . GetHashCode ( ) ; // $ Alert
1310 default ( sbyte ) . GetHashCode ( ) ; // $ Alert
1411
1512 // These are all good:
13+ default ( uint ) . GetHashCode ( ) ;
14+ default ( long ) . GetHashCode ( ) ;
15+ default ( ulong ) . GetHashCode ( ) ;
1616 default ( double ) . GetHashCode ( ) ;
1717 default ( float ) . GetHashCode ( ) ;
1818 default ( char ) . GetHashCode ( ) ;
Original file line number Diff line number Diff line change 1- | IntGetHashCode.cs:6:9:6:35 | call to method GetHashCode | Calling GetHashCode() on type uint is redundant. |
2- | IntGetHashCode.cs:7:9:7:34 | call to method GetHashCode | Calling GetHashCode() on type int is redundant. |
3- | IntGetHashCode.cs:8:9:8:35 | call to method GetHashCode | Calling GetHashCode() on type long is redundant. |
4- | IntGetHashCode.cs:9:9:9:36 | call to method GetHashCode | Calling GetHashCode() on type ulong is redundant. |
5- | IntGetHashCode.cs:10:9:10:36 | call to method GetHashCode | Calling GetHashCode() on type short is redundant. |
6- | IntGetHashCode.cs:11:9:11:37 | call to method GetHashCode | Calling GetHashCode() on type ushort is redundant. |
7- | IntGetHashCode.cs:12:9:12:35 | call to method GetHashCode | Calling GetHashCode() on type byte is redundant. |
8- | IntGetHashCode.cs:13:9:13:36 | call to method GetHashCode | Calling GetHashCode() on type sbyte is redundant. |
1+ | IntGetHashCode.cs:6:9:6:34 | call to method GetHashCode | Calling GetHashCode() on type int is redundant. |
2+ | IntGetHashCode.cs:7:9:7:36 | call to method GetHashCode | Calling GetHashCode() on type short is redundant. |
3+ | IntGetHashCode.cs:8:9:8:37 | call to method GetHashCode | Calling GetHashCode() on type ushort is redundant. |
4+ | IntGetHashCode.cs:9:9:9:35 | call to method GetHashCode | Calling GetHashCode() on type byte is redundant. |
5+ | IntGetHashCode.cs:10:9:10:36 | call to method GetHashCode | Calling GetHashCode() on type sbyte is redundant. |
You can’t perform that action at this time.
0 commit comments