rrb-common 0.1.7 → 0.1.8
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.
- checksums.yaml +4 -4
- data/lib/rune/core/writeable_buffer.rb +8 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e485c8c918938ea3b3a6ece7f985818b568e7985d4313df90e22965ff64a977
|
4
|
+
data.tar.gz: c787f77c5555d8b65d5f0c026a14e21a37a587abb9b3b72d21d8f9c0b82abf3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f09bac24c6493d888dc4bb4e0a4cdc720bba53df704ac15bd7b21d8d019c635271cbc2854640fbb5361a392b396163fd520ca13d914f27043510c24283ea2da3
|
7
|
+
data.tar.gz: a46a128393cbb71962f7200d287f5b859a7b674812efc4ef341f034dd8fc7b42b447434f012da3b1fe1d17c4615df5dcadb28e6d43a0f2420376f62e4c4e94ba
|
@@ -167,22 +167,22 @@ module RuneRb::Core::WriteableBuffer
|
|
167
167
|
@bit_position += amount
|
168
168
|
|
169
169
|
while amount > bit_offset
|
170
|
-
@
|
171
|
-
@
|
172
|
-
@
|
170
|
+
@data[byte_pos] = [0].pack('c') if @data[byte_pos].nil?
|
171
|
+
@data[byte_pos] = [(@data[byte_pos].unpack1('c') & ~RuneRb::Core::BIT_MASK_OUT[bit_offset])].pack('c')
|
172
|
+
@data[byte_pos] = [(@data[byte_pos].unpack1('c') | (value >> (amount - bit_offset)) & RuneRb::Core::BIT_MASK_OUT[bit_offset])].pack('c')
|
173
173
|
byte_pos += 1
|
174
174
|
amount -= bit_offset
|
175
175
|
bit_offset = 8
|
176
176
|
end
|
177
177
|
|
178
|
-
@
|
178
|
+
@data[byte_pos] = [0].pack('c') if @data[byte_pos].nil?
|
179
179
|
|
180
180
|
if amount == bit_offset
|
181
|
-
@
|
182
|
-
@
|
181
|
+
@data[byte_pos] = [(@data[byte_pos].unpack1('c') & ~RuneRb::Core::BIT_MASK_OUT[bit_offset])].pack('c')
|
182
|
+
@data[byte_pos] = [(@data[byte_pos].unpack1('c') | (value & RuneRb::Core::BIT_MASK_OUT[bit_offset]))].pack('c')
|
183
183
|
else
|
184
|
-
@
|
185
|
-
@
|
184
|
+
@data[byte_pos] = [(@data[byte_pos].unpack1('c') & ~(RuneRb::Core::BIT_MASK_OUT[amount] << (bit_offset - amount)))].pack('c')
|
185
|
+
@data[byte_pos] = [(@data[byte_pos].unpack1('c') | ((value & RuneRb::Core::BIT_MASK_OUT[amount]) << (bit_offset - amount)))].pack('c')
|
186
186
|
end
|
187
187
|
end
|
188
188
|
end
|