From 2fb0329bbd5dfa9dd4a471af95690a19d04fe920 Mon Sep 17 00:00:00 2001 From: Max Maischein Date: Sun, 20 Sep 2020 20:13:24 +0200 Subject: [PATCH] Eliminate call to strlen() in favour of SvPV() --- dbdimp_tokenizer.inc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dbdimp_tokenizer.inc b/dbdimp_tokenizer.inc index c0ac4d2..c6759b4 100644 --- a/dbdimp_tokenizer.inc +++ b/dbdimp_tokenizer.inc @@ -508,7 +508,6 @@ static int perl_fts5_tokenizer_Tokenize( PUTBACK; call_sv(c->coderef, G_VOID); - printf("Returned from tokenization CB, returning to SQLite\n"); SPAGAIN; PUTBACK; @@ -525,8 +524,8 @@ int perl_fts5_xToken(pTHX_ int iStart, /* Byte offset of token within input text */ int iEnd /* Byte offset of end of token within input text */ ) { - const char* chrToken = SvPV_nolen(svToken); - STRLEN nToken = strlen(chrToken); + STRLEN nToken; + const char* chrToken = SvPV(svToken, nToken); perl_cb_ctx * p = (perl_cb_ctx *)SvPV_nolen( pCtx ); return p->xToken(p->Ctx,tflags,chrToken,nToken,iStart,iEnd); }