mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:18:12 +00:00
LibAudio: Stop passing Bytes
by reference
`Bytes` is very slim, so the memory and/or performance gains from passing it by reference isn't that big, and it passing it by value is more compatible with xvalues, which is handy for things like `::try_create(buffer.bytes())`.
This commit is contained in:
parent
385ba1280b
commit
3cf93d0dd2
2 changed files with 3 additions and 3 deletions
|
@ -56,7 +56,7 @@ Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> Loader::try_create(StringView p
|
|||
return LoaderError { "No loader plugin available" };
|
||||
}
|
||||
|
||||
Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> Loader::try_create(Bytes& buffer)
|
||||
Result<NonnullOwnPtr<LoaderPlugin>, LoaderError> Loader::try_create(Bytes buffer)
|
||||
{
|
||||
NonnullOwnPtr<LoaderPlugin> plugin = adopt_own(*new WavLoaderPlugin(buffer));
|
||||
if (auto initstate = plugin->initialize(); !initstate.is_error())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue