1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-12 23:50:59 +00:00
serenity/Meta/Lagom/Tools/CodeGenerators
Timothy Flynn 604d5f5bca AK+Everywhere: Do not implicitly copy variables in TRY macros
For example, consider cases where we want to propagate errors only in
specific instances:

    auto result = read_data(); // something like ErrorOr<ByteBuffer>
    if (result.is_error() && result.error().code() != EINTR)
        continue;
    auto bytes = TRY(result);

The TRY invocation will currently copy the byte buffer when the
expression (in this case, just a local variable) is stored into
_temporary_result.

This patch binds the expression to a reference to prevent such copies.
In less trival invocations (such as TRY(some_function()), this will
incur only temporary lifetime extensions, i.e. no functional change.
2023-02-10 09:08:52 +00:00
..
IPCCompiler AK: Remove the fallible constructor from FixedMemoryStream 2023-02-08 17:44:32 +00:00
LibEDID AK: Remove StringBuilder::build() in favor of to_deprecated_string() 2023-01-27 20:38:49 +00:00
LibGL CodeGenerators: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-26 09:57:14 -05:00
LibLocale AK+Everywhere: Do not implicitly copy variables in TRY macros 2023-02-10 09:08:52 +00:00
LibTimeZone Everywhere: Use ReadonlySpan<T> instead of Span<T const> 2023-02-08 19:15:45 +00:00
LibUnicode Everywhere: Use ReadonlySpan<T> instead of Span<T const> 2023-02-08 19:15:45 +00:00
LibWeb LibJS+LibWeb: Convert string view PrimitiveString instances to String 2023-02-09 17:13:33 +00:00
StateMachineGenerator LibCore: Rename Stream::read_all to read_until_eof 2022-12-12 14:16:42 +01:00
CMakeLists.txt LibGL: Generate the API wrappers 2022-12-20 10:42:31 +01:00