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
3
3
void Test ( )
4
4
{
5
5
// These are all bad:
6
- default ( uint ) . GetHashCode ( ) ; // $ Alert
7
6
default ( int ) . GetHashCode ( ) ; // $ Alert
8
- default ( long ) . GetHashCode ( ) ; // $ Alert
9
- default ( ulong ) . GetHashCode ( ) ; // $ Alert
10
7
default ( short ) . GetHashCode ( ) ; // $ Alert
11
8
default ( ushort ) . GetHashCode ( ) ; // $ Alert
12
9
default ( byte ) . GetHashCode ( ) ; // $ Alert
13
10
default ( sbyte ) . GetHashCode ( ) ; // $ Alert
14
11
15
12
// These are all good:
13
+ default ( uint ) . GetHashCode ( ) ;
14
+ default ( long ) . GetHashCode ( ) ;
15
+ default ( ulong ) . GetHashCode ( ) ;
16
16
default ( double ) . GetHashCode ( ) ;
17
17
default ( float ) . GetHashCode ( ) ;
18
18
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