mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:47:34 +00:00
LibCrypto: Use BitmapView instead of Bitmap::wrap()
This commit is contained in:
parent
a1d1a3b50b
commit
ed9ab38b3b
3 changed files with 5 additions and 6 deletions
|
@ -190,14 +190,13 @@ Result<StringView, DecodeError> Decoder::decode_printable_string(ReadonlyBytes d
|
|||
return StringView { data };
|
||||
}
|
||||
|
||||
Result<Bitmap, DecodeError> Decoder::decode_bit_string(ReadonlyBytes data)
|
||||
Result<const BitmapView, DecodeError> Decoder::decode_bit_string(ReadonlyBytes data)
|
||||
{
|
||||
if (data.size() < 1)
|
||||
return DecodeError::InvalidInputFormat;
|
||||
|
||||
auto unused_bits = data[0];
|
||||
// FIXME: It's rather annoying that `Bitmap` is always mutable.
|
||||
return Bitmap::wrap(const_cast<u8*>(data.offset_pointer(1)), data.size() * 8 - unused_bits);
|
||||
return BitmapView { const_cast<u8*>(data.offset_pointer(1)), data.size() * 8 - unused_bits };
|
||||
}
|
||||
|
||||
Result<Tag, DecodeError> Decoder::peek()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue