Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitff4b5c5

Browse files
committed
do not use recursion in Cover() - ~2% performance
1 parent3283aed commitff4b5c5

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

‎rum_ts_utils.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -656,15 +656,13 @@ Cover(DocRepresentation *doc, uint32 len, QueryRepresentation *qr,
656656
Extention*ext)
657657
{
658658
DocRepresentation*ptr;
659-
intlastpos=ext->pos;
659+
intlastpos;
660660
inti;
661-
boolfound= false;
661+
boolfound;
662662

663-
/*
664-
* since this function recurses, it could be driven to stack overflow.
665-
* (though any decent compiler will optimize away the tail-recursion.
666-
*/
667-
check_stack_depth();
663+
restart:
664+
lastpos=ext->pos;
665+
found= false;
668666

669667
memset(qr->operandexist,0,sizeof(bool)*qr->lenght);
670668

@@ -742,7 +740,7 @@ Cover(DocRepresentation *doc, uint32 len, QueryRepresentation *qr,
742740
}
743741

744742
ext->pos++;
745-
returnCover(doc,len,qr,ext);
743+
gotorestart;
746744
}
747745

748746
staticDocRepresentation*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp