Skip to content

Commit

Permalink
tokens_match.h: Improved tail call optiomization.
Browse files Browse the repository at this point in the history
  • Loading branch information
eehakkin committed Sep 6, 2023
1 parent b35e9f6 commit 3d6e965
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pam-ssh-auth-info (1.8.20230906) unstable; urgency=low

* Fixed and updated documentation.
* Avoided some compiler warnings.
* Improved tail call optiomization.

-- Eero Häkkinen <[email protected]> Wed, 06 Sep 2023 21:19:19 +0300

Expand Down
9 changes: 8 additions & 1 deletion tokens_match.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,14 @@ tokens_match_extended_pattern(
* either the tokens head is not empty or the occurence
* count must be increased.
*/
if (match_len == info->match_len.max) {
if (
match_len == info->match_len.max ||
is_end_of_token(
config,
tokens_tail,
tokens_end
)
) {
/* Tail call optimization.
*/
++count;
Expand Down

0 comments on commit 3d6e965

Please sign in to comment.