most ▁occurrence ▁of ▁c ▁in ▁pat . ▁// ▁// ▁If ▁c ▁does ▁not ▁occur ▁in ▁pat , ▁then ▁delta 1 [ c ] ▁= ▁pat len . ▁// ▁If ▁c ▁is ▁at ▁string [ i ] ▁and ▁c ▁!= ▁pat [ pat len - 1 ], ▁we ▁can ▁safely ▁shift ▁i ▁// ▁▁ ▁over ▁by ▁delta 1 [ c ], ▁which ▁is ▁the ▁minimum ▁distance ▁needed ▁to ▁shift ▁// ▁▁ ▁pat ▁forward ▁to ▁get ▁string [ i ] ▁l ined ▁up ▁with ▁some ▁character ▁in ▁pat . ▁// ▁c ▁== ▁pat [ pat len - 1 ] ▁returning ▁zero ▁is ▁only ▁a ▁concern ▁for ▁B M H , ▁which ▁// ▁▁ ▁does ▁not ▁have ▁delta 2 . ▁B M H ▁makes ▁the ▁value ▁pat len ▁in ▁such ▁a ▁case . ▁// ▁▁ ▁We ▁follow ▁this ▁choice ▁instead ▁of ▁the ▁original ▁ 0 ▁because ▁it ▁ski ps ▁// ▁▁ ▁more . ▁( correct ness ?) ▁// ▁// ▁This ▁algorithm ▁runs ▁in ▁alphabet _ len + pat len ▁time . ▁void ▁make _ delta 1 ( pt rd iff _ t ▁* delta 1 , ▁uint 8 _ t ▁* pat , ▁size _ t ▁pat len ) ▁{ ▁▁▁▁ ▁for ▁( int ▁i = 0 ; ▁i ▁< ▁A LP H AB ET _ LE N ; ▁i ++) ▁{ ▁▁▁▁▁▁▁▁ ▁delta 1 [ i ] ▁= ▁pat len ; ▁▁▁▁ ▁} ▁▁▁▁ ▁for ▁( int ▁i = 0 ; ▁i ▁< ▁pat len - 2 ; ▁i ++) ▁{ ▁▁▁▁▁▁▁▁ ▁delta 1 [