summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/context.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/context.rs b/src/context.rs
index b72182d..9fb3bf4 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -30,7 +30,7 @@ impl<'i, T> Context<'i, T> {
/// lookup k n (insert j v c) = lookup k n c -- k /= j
/// ```
pub fn lookup<'a>(&'a self, k: &str, n: usize) -> Option<&'a T> {
- self.0.get(k).and_then(|v| v.get(n))
+ self.0.get(k).and_then(|v| v.get(v.len() - 1 - n))
}
pub fn map<U, F: Fn(&T) -> U>(&self, f: F) -> Context<'i, U> {