From 85848e1bbfbcccd5b3bc5344bed58c902091deef Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Sun, 16 Jun 2019 06:32:37 -0400 Subject: [PATCH] complete mysterious comments --- src/interned.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interned.rs b/src/interned.rs index 86351c75..145fc61a 100644 --- a/src/interned.rs +++ b/src/interned.rs @@ -252,7 +252,7 @@ where fn intern_check(&self, db: &DB, key: &Q::Key) -> Option> { let revision_now = db.salsa_runtime().current_revision(); - // First, + // First, try with read lock -- this only works if `accessed_at` is up to date. { let tables = self.tables.read(); let &index = tables.map.get(key)?; @@ -282,7 +282,7 @@ where } } - // Next, + // Acquire write lock if necessary. let mut tables = self.tables.write(); let &index = tables.map.get(key)?; match &mut tables.values[index.as_usize()] {