comparison tools/fanalyze.c @ 2272:4f52b7f5fe51

Bail out from the matching search if we exceed the match limits.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 17 Jun 2019 11:50:12 +0300
parents dcf9abeec930
children 6878aad714ce
comparison
equal deleted inserted replaced
2271:dcf9abeec930 2272:4f52b7f5fe51
954 } 954 }
955 955
956 if (cnt >= optMinMatchLen) 956 if (cnt >= optMinMatchLen)
957 { 957 {
958 // Match found 958 // Match found
959 dmAddMatchSequence(file1->data + moffs1, cnt, file1, moffs1); 959 if (!dmAddMatchSequence(file1->data + moffs1, cnt, file1, moffs1) ||
960 dmAddMatchSequence(file2->data + moffs2, cnt, file2, moffs2); 960 !dmAddMatchSequence(file2->data + moffs2, cnt, file2, moffs2))
961 goto done;
962
961 moffs1 += cnt; 963 moffs1 += cnt;
962 } 964 }
963 } 965 }
964 966
965 if (cnt < optMinMatchLen) 967 if (cnt < optMinMatchLen)
966 moffs1++; 968 moffs1++;
967 } 969 }
968 } 970 }
969 file1->analyzed = TRUE; 971 file1->analyzed = TRUE;
970 } 972 }
973
974 done:
971 975
972 for (int nmatch = 0; nmatch < ndmSequences; nmatch++) 976 for (int nmatch = 0; nmatch < ndmSequences; nmatch++)
973 { 977 {
974 DMMatchSeq *seq = &dmSequences[nmatch]; 978 DMMatchSeq *seq = &dmSequences[nmatch];
975 979