]) ▁&& ▁( i ▁< ▁pos ); ▁i ++ ); ▁▁▁▁ ▁return ▁i ; ▁} ▁ ▁// ▁GO OD ▁SU F FIX ▁R U LE . ▁// ▁delta 2 ▁table : ▁given ▁a ▁mismatch ▁at ▁pat [ pos ], ▁we ▁want ▁to ▁align ▁// ▁with ▁the ▁next ▁possible ▁full ▁match ▁could ▁be ▁based ▁on ▁what ▁we ▁// ▁know ▁about ▁pat [ pos + 1 ] ▁to ▁pat [ pat len - 1 ]. ▁// ▁// ▁In ▁case ▁ 1 : ▁// ▁pat [ pos + 1 ] ▁to ▁pat [ pat len - 1 ] ▁does ▁not ▁occur ▁elsewhere ▁in ▁pat , ▁// ▁the ▁next ▁pla us ible ▁match ▁starts ▁at ▁or ▁after ▁the ▁mismatch . ▁// ▁If , ▁within ▁the ▁substring ▁pat [ pos + 1 ▁.. ▁pat len - 1 ], ▁lies ▁a ▁prefix ▁// ▁of ▁pat , ▁the ▁next ▁pla us ible ▁match ▁is ▁here ▁( if ▁there ▁are ▁multiple ▁// ▁prefix es ▁in ▁the ▁substring , ▁pick ▁the ▁longest ). ▁Otherwise , ▁the ▁// ▁next ▁pla us ible ▁match ▁starts ▁past ▁the ▁character ▁aligned ▁with ▁// ▁pat [ pat len - 1 ]. ▁// ▁// ▁In ▁case ▁ 2 : ▁// ▁pat [ pos + 1 ] ▁to ▁pat [ pat len - 1 ] ▁does ▁occur ▁elsewhere ▁in ▁pat . ▁The ▁// ▁mismatch ▁tells ▁us ▁that ▁we ▁are ▁not ▁looking ▁at ▁the ▁end ▁of ▁a ▁match . ▁// ▁We ▁may , ▁however , ▁be ▁looking ▁at ▁the ▁middle ▁of ▁a ▁match . ▁// ▁// ▁The ▁first ▁loop ,