Created
February 13, 2016 16:19
-
-
Save zchtodd/11b2d4fd9802bf7df729 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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