C#: Enable nullability checks on Semmle.Extraction.CIL

This commit is contained in:
Tamas Vajk
2020-08-19 14:53:40 +02:00
parent d56a03389c
commit 9cdee63ed7
22 changed files with 286 additions and 179 deletions

View File

@@ -64,7 +64,7 @@ namespace Semmle.Util
/// Enumerates a possibly null enumerable.
/// If the enumerable is null, the list is empty.
/// </summary>
public static IEnumerable<T> EnumerateNull<T>(this IEnumerable<T> items)
public static IEnumerable<T> EnumerateNull<T>(this IEnumerable<T>? items)
{
if (items == null) yield break;
foreach (var item in items) yield return item;
@@ -93,7 +93,7 @@ namespace Semmle.Util
/// <typeparam name="T">The type of the item.</typeparam>
/// <param name="items">The list of items to hash.</param>
/// <returns>The hash code.</returns>
public static int SequenceHash<T>(this IEnumerable<T> items) where T: notnull
public static int SequenceHash<T>(this IEnumerable<T> items) where T : notnull
{
int h = 0;
foreach (var i in items)