Skip to content

Commit 386a1ed

Browse files
Copilotericcurtin
andcommitted
Remove redundant clear() call on empty string
Co-authored-by: ericcurtin <1694275+ericcurtin@users.noreply.github.com>
1 parent 928d8b1 commit 386a1ed

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llamacpp/native/src/server/server-context.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,10 +1055,9 @@ struct server_context_impl {
10551055
common_sampler_free(slot.smpl);
10561056
}
10571057

1058-
// If grammar is an empty string, clear it to ensure common_sampler_init doesn't try to parse it
1058+
// If grammar is an empty string, clear related fields to ensure common_sampler_init doesn't fail
10591059
// Empty grammar means no grammar constraints should be applied
10601060
if (task.params.sampling.grammar.empty()) {
1061-
task.params.sampling.grammar.clear();
10621061
task.params.sampling.grammar_triggers.clear();
10631062
task.params.sampling.grammar_lazy = false;
10641063
}

0 commit comments

Comments
 (0)