skiplist 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/History.txt +4 -0
  2. data/lib/skiplist.rb +9 -3
  3. metadata +2 -2
@@ -1,3 +1,7 @@
1
+ === 0.0.2 2010-Aug-13
2
+
3
+ * Fix empty? method behavior when there is marked node.
4
+
1
5
  === 0.0.1 2010-Aug-13
2
6
 
3
7
  * Initial release
@@ -35,7 +35,7 @@ THE SOFTWARE.
35
35
  #= Lock-Free Skip List
36
36
  #
37
37
  #Authors:: KISHIMOTO, Makoto
38
- #Version:: 0.0.1 2010-Aug-13
38
+ #Version:: 0.0.2 2010-Aug-13
39
39
  #Copyright:: Copyright (c) 2010 KISHIMOTO, Makoto
40
40
  #License:: (other than loop.rb ) X License
41
41
  #
@@ -44,7 +44,7 @@ THE SOFTWARE.
44
44
  #- The Art of Multiprocessor Programming, Chap. 14
45
45
  #
46
46
  class SkipList
47
- VERSION = '0.0.1'
47
+ VERSION = '0.0.2'
48
48
 
49
49
  #
50
50
  # Node of SkipList, inner use only
@@ -145,7 +145,13 @@ class SkipList
145
145
  # Returns <code>true</code> if <i>lst</i> contains no elements.
146
146
  #
147
147
  def empty?
148
- @head[0].get_link.equal? @tail
148
+ p = @head[0].get_link
149
+ pp, m = p[0].get
150
+ while m do
151
+ p = pp
152
+ pp, m = p[0].get
153
+ end
154
+ p.equal? @tail
149
155
  end
150
156
 
151
157
  #
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - KISHIMOTO, Makoto