summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKyrylo Silin <silin@kyrylo.org>2021-06-28 22:31:53 +0300
committerKyrylo Silin <silin@kyrylo.org>2021-06-28 22:33:20 +0300
commit0c677b7a1db3e204e78ac682487e8c6345c7f64b (patch)
tree6271741080acc0d553063678ccdf5ad8693df546 /lib
parent0aae8c94ad03a732659ed56dcd5088469a15eebf (diff)
downloadpry-0c677b7a1db3e204e78ac682487e8c6345c7f64b.tar.gz
ring: change guard priority so that the value at index can be read
Fixes #2199 (`_out_` Ring is ill-addressible)
Diffstat (limited to 'lib')
-rw-r--r--lib/pry/ring.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pry/ring.rb b/lib/pry/ring.rb
index a61d077a..653ffb59 100644
--- a/lib/pry/ring.rb
+++ b/lib/pry/ring.rb
@@ -56,8 +56,8 @@ class Pry
# exist
def [](index)
@mutex.synchronize do
- return @buffer[(count + index) % max_size] if index.is_a?(Integer)
return @buffer[index] if count <= max_size
+ return @buffer[(count + index) % max_size] if index.is_a?(Integer)
transpose_buffer_tail[index]
end