We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3be552 commit a7a3fc4Copy full SHA for a7a3fc4
lib/xgboost/utils.rb
@@ -23,11 +23,9 @@ def string_pointer(value)
23
end
24
25
def from_cstr_to_rbstr(data, length)
26
- res = []
27
- length.read_uint64.times do |i|
28
- res << data.read_pointer.get_pointer(i * ::FFI::Pointer.size).read_string.force_encoding(Encoding::UTF_8)
+ data.read_pointer.read_array_of_pointer(length.read_uint64).map do |ptr|
+ ptr.read_string.force_encoding(Encoding::UTF_8)
29
30
- res
31
32
33
0 commit comments