put returns previous value, so separate get is redundant

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@761412 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2009-04-02 20:14:46 +00:00
parent c386d36a69
commit 6fc6e048a3
1 changed files with 3 additions and 4 deletions

View File

@ -72,10 +72,9 @@ class EfficientBidiMap implements Serializable
public void put(String key, IColumn column) public void put(String key, IColumn column)
{ {
IColumn oldColumn = map_.get(key); IColumn oldColumn = map_.put(key, column);
if( oldColumn != null ) if (oldColumn != null)
sortedSet_.remove( oldColumn ); sortedSet_.remove(oldColumn);
map_.put(key, column);
sortedSet_.add(column); sortedSet_.add(column);
} }