Permalink
Browse files

Make removeServer more robust

  • Loading branch information...
1 parent 26b0aa4 commit cf7bdc9296b335e87621b03bc160cde1f3000393 @ozataman ozataman committed Sep 17, 2012
Showing with 4 additions and 4 deletions.
  1. +1 −1 cassy.cabal
  2. +3 −3 src/Database/Cassandra/Pool.hs
View
@@ -1,5 +1,5 @@
Name: cassy
-Version: 0.4.1.0
+Version: 0.4.1.1
Synopsis: A high level driver for the Cassandra datastore
License: BSD3
License-file: LICENSE
@@ -187,11 +187,11 @@ next Ring{..}
------------------------------------------------------------------------------
removeServer :: Ord a => a -> Ring a -> Ring a
removeServer s r@Ring{..}
- | s `S.member` allItems = Ring (S.delete s allItems) current' used' upcoming'
+ | s `S.member` allItems = Ring all' cur' [] up'
| otherwise = r
where
- used' = filter (/=s) used
- (current':upcoming') = filter (/=s) (current:upcoming)
+ all' = S.delete s allItems
+ cur' : up' = S.toList all'
------------------------------------------------------------------------------

0 comments on commit cf7bdc9

Please sign in to comment.