Skip to content

Commit

Permalink
Add where T : Command constraint on GetCommandsOfType<T>
Browse files Browse the repository at this point in the history
It doesn't make send to pass anything else but a `Command` as the generic type parameter of `GetCommandsOfType<T>`.
  • Loading branch information
0xced committed Apr 6, 2022
1 parent 4e3ccb6 commit 65dc434
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ELFSharp/MachO/MachO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal MachO(Stream stream, bool is64, Endianess endianess, bool ownsStream)
ReadCommands(noOfCommands, stream, reader);
}

public IEnumerable<T> GetCommandsOfType<T>()
public IEnumerable<T> GetCommandsOfType<T>() where T : Command
{
return commands.Where(x => x != null).OfType<T>();
}
Expand Down

0 comments on commit 65dc434

Please sign in to comment.