Skip to content

Commit babff06

Browse files
committed
removed unnecessary comparison
1 parent 62b9cb4 commit babff06

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llama.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13067,9 +13067,8 @@ void llama_sample_dry(llama_token_data_array * candidates, const llama_token * l
1306713067
// if we have reached the start of our stored prev, break
1306813068
if(j - match_length > 0) break;
1306913069

13070-
// this shouldn't happen because (j - match_length) should always be smaller than (size - match_length)
13071-
// but let's check here to avoid the unexpected
13072-
if(last_tokens_size - match_length < 0) break;
13070+
// (last_tokens_size - match_length) is unsigned so will always be greater or equal to 0
13071+
// so no need to check for index out of bound here
1307313072

1307413073
// compare token starts at our prev index, going backwards by match length
1307513074
auto compare_token = last_tokens[j - match_length];

0 commit comments

Comments
 (0)