]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
whisper : remove redundant assignments (#3178)
authorDaniel Bevenius <redacted>
Wed, 21 May 2025 11:23:20 +0000 (13:23 +0200)
committerGitHub <redacted>
Wed, 21 May 2025 11:23:20 +0000 (13:23 +0200)
This commit removes some redundant assignments in the function
`whisper_exp_compute_token_level_timestamps`.

The motivations for this is that tokens[j] and token are references to
the same object and this can be a little confusing when reading the
code.

src/whisper.cpp

index 8bad4d1391a5ea6ae3fa8844b5841d30aefdeabd..cb887d4593b46a7911c0191d77c7234d30421707 100644 (file)
@@ -8397,12 +8397,6 @@ static void whisper_exp_compute_token_level_timestamps(
 
         const int64_t tt = t_beg + 2*(token.tid - whisper_token_beg(&ctx));
 
-        tokens[j].id    = token.id;
-        tokens[j].tid   = token.tid;
-        tokens[j].p     = token.p;
-        tokens[j].pt    = token.pt;
-        tokens[j].ptsum = token.ptsum;
-
         tokens[j].vlen = voice_length(whisper_token_to_str(&ctx, token.id));
 
         if (token.pt > thold_pt && token.ptsum > thold_ptsum && token.tid > tid_last && tt <= t1) {