return null;
} else {
// complete the GCAS
- MainNode<K, V> prev = /* READ */ m.READ_PREV();
+ final MainNode<K, V> prev = /* READ */ m.READ_PREV();
INode<K, V> ctr = ct.readRoot(true);
if (prev == null) {
m = /* READ */ READ();
continue;
}
- } else if (prev instanceof MainNode) {
+ } else {
// Assume that you've read the root from the generation
// G.
// Assume that the snapshot algorithm is correct.
}
}
}
- throw new RuntimeException ("Should not happen");
}
}
} else if (m instanceof LNode) {
// 5) an l-node
Option<V> tmp = ((LNode<K, V>) m).get (k);
- return (tmp instanceof Option) ? ((Option<V>) tmp) : null;
+ return (tmp != null) ? ((Option<V>) tmp) : null;
}
throw new RuntimeException ("Should not happen");