refactor(grammar): use is_multiple_of and let-chains
Replace modulo operations with is_multiple_of calls and simplify nested if statements using let-chains in the grammar generator. Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
This commit is contained in:
@ -2232,7 +2232,7 @@ mod generator {
|
||||
self.emit(alts[idx], out);
|
||||
}
|
||||
Expr::Opt(inner) => {
|
||||
if self.pick() % 3 != 0 {
|
||||
if !self.pick().is_multiple_of(3) {
|
||||
// ~66% chance of emitting
|
||||
self.emit(inner, out);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user