Skip to content

Commit c12012b

Browse files
wip
1 parent a69f44e commit c12012b

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

spec/runners/binary_vector.rb

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@ def valid?
4646
end
4747

4848
def document_from_canonical_bson
49-
@document_from_canonical_bson ||= begin
50-
bson_bytes = decode_hex(@canonical_bson)
51-
buffer = BSON::ByteBuffer.new(bson_bytes)
52-
BSON::Document.from_bson(buffer)
53-
end
49+
bson_bytes = decode_hex(@canonical_bson)
50+
buffer = BSON::ByteBuffer.new(bson_bytes)
51+
BSON::Document.from_bson(buffer)
52+
5453
end
5554

5655
def canonical_bson_from_document(use_vector_type: false, validate_vector_data: false)
@@ -59,15 +58,12 @@ def canonical_bson_from_document(use_vector_type: false, validate_vector_data: f
5958
else
6059
[ @vector, @dtype, @padding ]
6160
end
62-
@canonical_bson_from_document ||= begin
63-
document ||= {
64-
@spec.test_key => BSON::Binary.from_vector(
65-
*args,
66-
validate_vector_data: validate_vector_data
67-
),
68-
}
69-
document.to_bson.to_s
70-
end
61+
{
62+
@spec.test_key => BSON::Binary.from_vector(
63+
*args,
64+
validate_vector_data: validate_vector_data
65+
),
66+
}.to_bson.to_s
7167
end
7268

7369
def bson

0 commit comments

Comments
 (0)