dain / leveldb

Port of LevelDB to Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

why not assign current as a temp variable in versionSet.get(lookupKey) in DBImpl.(byte[] key, ReadOptions options)?

wolflike opened this issue · comments

Find the value of key from the current variable of versionset. Why not assign current to a variable? If the data is directly obtained from the current variable, the compaction thread may update the current variable, which destroys the reading process.

public LookupResult get(LookupKey key)
{
//there
//Version temp = current;
//return temp.get(key);
return current.get(key);
}