Commit 1dcb8ec5 authored by Doug Barrett's avatar Doug Barrett 🔴
Browse files

Merge branch 'master' into 'perf/lazy-string-key-conversion'

# Conflicts:
#   lib/labkit/logging/field_validator/registry.rb
parents 3f7e49d9 67f29f23
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ module Labkit
        def record_offense(callsite, lineno, deprecated_field, standard_field, logger_class)
          key = [callsite, deprecated_field, logger_class].freeze

          return if @offense_keys.include?(key)

          @mutex.synchronize do
            next if @offense_keys.include?(key)

@@ -35,18 +37,15 @@ module Labkit
              'logger_class' => logger_class
            }.freeze

            # If this offense was previously marked as removed, undo that
            @removed_offenses.reject! { |r| offense_key(r) == key }
          end
        end

        def check_for_removed_offenses(callsite, data, logger_class)
          @mutex.synchronize do
        def check_for_removed_offenses(callsite, fields, logger_class)
          baseline = baseline_by_callsite[[callsite, logger_class]]
            next unless baseline

            fields = extract_string_keys(data)
          return unless baseline

          @mutex.synchronize do
            baseline.each do |offense|
              key = offense_key(offense)
              next if @offense_keys.include?(key)