class K8S::Hashdiff::LinearCompareArray(T, V)

Overview

Used to compare arrays in a linear complexity, which produces longer diffs than using the lcs algorithm but is considerably faster

Defined in:

k8s/hashdiff/linear_compare_arrays.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(old_array : Array(T), new_array : Array(V), **options) #

[View source]

Class Method Detail

def self.call(old_array : Array(L), new_array : Array(M), **options) forall L, M #

[View source]

Instance Method Detail

def additions #

[View source]
def append_addition(item, index) #

[View source]
def append_addititions_before_match(match_index) #

[View source]
def append_deletion(item, index) #

[View source]
def append_deletions_before_match(match_index) #

[View source]
def append_differences(difference : Array(Tuple)) #

[View source]
def call #

[View source]
def compare_at_index #

[View source]
def deletions #

[View source]
def expected_additions : Int32 #

[View source]
def expected_additions=(expected_additions : Int32) #

[View source]
def extra_items_in_new_array? #

[View source]
def extra_items_in_old_array? #

[View source]
def index_of_match_after_additions #

look ahead in the new array to see if the current item appears later thereby having new items added


[View source]
def index_of_match_after_deletions #

look ahead in the old array to see if the current item appears later thereby having items removed


[View source]
def item_difference(old_item, new_item, item_index) #

[View source]
def iterated_through_both_arrays? #

[View source]
def new_array : Array(V) #

[View source]
def new_index : Int32 #

[View source]
def new_index=(new_index : Int32) #

[View source]
def old_array : Array(T) #

[View source]
def old_index : Int32 #

getter differences = Array(Tuple(String, Array(Int32 | String | Symbol) | Array(Int32 | String) | String, T) | Tuple(String, Array(Int32 | String | Symbol) | Array(Int32 | String) | String, V)).new


[View source]
def old_index=(old_index : Int32) #

getter differences = Array(Tuple(String, Array(Int32 | String | Symbol) | Array(Int32 | String) | String, T) | Tuple(String, Array(Int32 | String | Symbol) | Array(Int32 | String) | String, V)).new


[View source]
def options : Options #

[View source]