skiplist 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/lib/skiplist.rb +9 -3
- metadata +2 -2
data/History.txt
CHANGED
data/lib/skiplist.rb
CHANGED
@@ -35,7 +35,7 @@ THE SOFTWARE.
|
|
35
35
|
#= Lock-Free Skip List
|
36
36
|
#
|
37
37
|
#Authors:: KISHIMOTO, Makoto
|
38
|
-
#Version:: 0.0.
|
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.
|
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
|
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
|
#
|