Skip to content

Commit 1c9873b

Browse files
author
Artur Zakirov
committed
Added comments
1 parent 2101dd1 commit 1c9873b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

contrib/pg_trgm/trgm_op.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,11 @@ iterate_substring_similarity(int *trg2indexes,
479479
lower = tmp_lower;
480480
count = tmp_count;
481481
}
482+
/*
483+
* if we only check that substring similarity is greater than
484+
* pg_trgm.substring_limit we do not need to calculate a
485+
* maximum similarity
486+
*/
482487
if (check_only && smlr_cur >= trgm_substring_limit)
483488
break;
484489

@@ -492,6 +497,11 @@ iterate_substring_similarity(int *trg2indexes,
492497
}
493498

494499
smlr_max = Max(smlr_max, smlr_cur);
500+
/*
501+
* if we only check that substring similarity is greater than
502+
* pg_trgm.substring_limit we do not need to calculate a
503+
* maximum similarity
504+
*/
495505
if (check_only && smlr_max >= trgm_substring_limit)
496506
break;
497507

0 commit comments

Comments
 (0)