<commit_before>module Veritas
  module Logic
    class Predicate
      module Enumerable

        def optimize
          if includes_nothing?
            new_optimized_none
          elsif right_one?
            new_optimized_one
          elsif !optimized?
            new_optimized_enumerable
          else
            super
          end
        end

      private

        def optimize_right
          right = self.right

          if right.respond_to?(:to_inclusive)
            optimize_right_range
          elsif right.respond_to?(:select)
            optimize_right_enumerable
          else
            right
          end<commit_msg>Freeze Enumerable predicate arguments<commit_after>module Veritas
  module Logic
    class Predicate
      module Enumerable

        def initialize(left, right)
          super(left, right.nil? ? right : right.dup.freeze)
        end

        def optimize
          if includes_nothing?
            new_optimized_none
          elsif right_one?
            new_optimized_one
          elsif !optimized?
            new_optimized_enumerable
          else
            super
          end
        end

      private

        def optimize_right
          right = self.right

          if right.respond_to?(:to_inclusive)
            optimize_right_range
          elsif right.respond_to?(:select)
            optimize_right_enumerable
          else
            right
          end
{'fraction_non_alphanumeric': 0.0351123595505618, 'fraction_numerical': 0.0, 'mean_word_length': 1.4400684931506849, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6332904', 'n_tokens_mistral': 381, 'n_tokens_neox': 355, 'n_words': 84}