harden network and auth guards, boost themed fill

This commit is contained in:
2026-08-23 17:51:46 +03:00
parent aa70c61abd
commit 4dc4d615e5
5 changed files with 92 additions and 8 deletions
+12 -2
View File
@@ -241,6 +241,16 @@ pub fn generate_themed_puzzle(
) -> Result<Puzzle> {
let start = Instant::now();
// Bias the fill toward theme words when a theme is requested.
let theme_boost = theme_words
.filter(|w| !w.is_empty())
.map(|tw| {
let mut d = dict.clone();
d.boost_theme(tw);
d
});
let solve_dict = theme_boost.as_ref().unwrap_or(dict);
let cores = std::thread::available_parallelism()
.map(|n| n.get())
.unwrap_or(1)
@@ -250,7 +260,7 @@ pub fn generate_themed_puzzle(
if cores > 1 && config.width > 9 {
return parallel_generate(
config,
dict,
solve_dict,
clue_db,
difficulty,
theme,
@@ -260,7 +270,7 @@ pub fn generate_themed_puzzle(
);
}
sequential_generate(config, dict, clue_db, difficulty, theme, theme_words, start)
sequential_generate(config, solve_dict, clue_db, difficulty, theme, theme_words, start)
}
struct SolvedGrid {