Skip to content

Instantly share code, notes, and snippets.

@zchtodd
Created February 13, 2016 16:19
Show Gist options
  • Save zchtodd/11b2d4fd9802bf7df729 to your computer and use it in GitHub Desktop.
Save zchtodd/11b2d4fd9802bf7df729 to your computer and use it in GitHub Desktop.
impl OptimizedQuery {
pub fn new(query: &Query, lengths: &Vec<u32>) -> OptimizedQuery {
let mut offsets = vec![];
let mut last_length = 0;
for length in lengths {
offsets.push(last_length + length);
last_length = *length;
}
OptimizedQuery {
offsets: offsets,
exacts: vec![],
contains: vec![],
gte: vec![],
lte: vec![],
gt: vec![],
lt: vec![]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment