MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / crossover

Function crossover

src/mutation.rs:79–94  ·  view source on GitHub ↗
(
    prompt1: Vec<String>,
    prompt2: Vec<String>,
    index1: usize,
    index2: usize,
    len: usize,
)

Source from the content-addressed store, hash-verified

77}
78
79fn crossover(
80 prompt1: Vec<String>,
81 prompt2: Vec<String>,
82 index1: usize,
83 index2: usize,
84 len: usize,
85) -> Vec<String> {
86 let mut combination = Vec::new();
87 let first_part = &prompt1[0..index1];
88 combination.extend_from_slice(first_part);
89 let second_part = &prompt2[index2..(index2 + len)];
90 combination.extend_from_slice(second_part);
91 let third_part = &prompt1[(index1 + len)..];
92 combination.extend_from_slice(third_part);
93 combination
94}
95
96/// Retain the uncovered APIs, and replace with covered APIs with those chosed from High Quality Prompt.
97fn prompt_crossover(prompt1: Vec<String>, prompt2: Vec<String>) -> Vec<String> {

Callers 1

prompt_crossoverFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected