<commit_before>﻿#pragma warning disable IDE0008 // Use explicit type

using System;
using System.Reflection;
using System.Linq.Expressions;
using MonoMod.Utils;
using System.Collections.Generic;
using Mono.Cecil;
using System.ComponentModel;
using Mono.Cecil.Cil;
using MethodBody = Mono.Cecil.Cil.MethodBody;
using System.Linq;
using MonoMod.Cil;

namespace MonoMod.Cil {
    public static class ILPatternMatchingExt {

        public static bool Match(this Instruction instr, OpCode opcode)
            => instr.OpCode == opcode;
        public static bool Match<T>(this Instruction instr, OpCode opcode, T value)
            => instr.Match(opcode, out T v) && (v?.Equals(value) ?? value == null);
        public static bool Match<T>(this Instruction instr, OpCode opcode, out T value) {
            if (instr.OpCode == opcode) {
                value = (T) instr.Operand;
                return false;
            }
            value = default;
            return false;
        }

        public static bool MatchNop(this Instruction instr) {
            if (instr.OpCode == OpCodes.Nop) {
                return true;
            }
            return false;
        } // OperandType.InlineNone<commit_msg>Fix ILPatternMatchingExt.Match<T>(Instruction, OpCode, out T)<commit_after>﻿#pragma warning disable IDE0008 // Use explicit type

using System;
using System.Reflection;
using System.Linq.Expressions;
using MonoMod.Utils;
using System.Collections.Generic;
using Mono.Cecil;
using System.ComponentModel;
using Mono.Cecil.Cil;
using MethodBody = Mono.Cecil.Cil.MethodBody;
using System.Linq;
using MonoMod.Cil;

namespace MonoMod.Cil {
    public static class ILPatternMatchingExt {

        public static bool Match(this Instruction instr, OpCode opcode)
            => instr.OpCode == opcode;
        public static bool Match<T>(this Instruction instr, OpCode opcode, T value)
            => instr.Match(opcode, out T v) && (v?.Equals(value) ?? value == null);
        public static bool Match<T>(this Instruction instr, OpCode opcode, out T value) {
            if (instr.OpCode == opcode) {
                value = (T) instr.Operand;
                return true;
            }
            value = default;
            return false;
        }

        public static bool MatchNop(this Instruction instr) {
            if (instr.OpCode == OpCodes.Nop) {
                return true;
            }
            return false;
        } // OperandType.InlineNone
{'fraction_non_alphanumeric': 0.09363599513579246, 'fraction_numerical': 0.0032428050263477908, 'mean_word_length': 2.3808219178082193, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '810934', 'n_tokens_mistral': 697, 'n_tokens_neox': 684, 'n_words': 203}