Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/LogExpert.Core/Classes/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public static int DamerauLevenshteinDistance (string src, string dest)

public static unsafe int YetiLevenshtein (string s1, string s2)
{
ArgumentNullException.ThrowIfNull(s1);
ArgumentNullException.ThrowIfNull(s2);
s1 ??= string.Empty;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is a correct way to handle s1 and s2 in case of null. You are hiding the fact that there is a null there and I think that in case of null you should not even call this method.

In short:
I would like to know in case we got here with null and prevent it in the future.

s2 ??= string.Empty;

fixed (char* p1 = s1)
fixed (char* p2 = s2)
Expand Down
Loading