refactor: prefer orelse to if(pred) |x| x else y

This commit is contained in:
CJ van den Berg 2024-08-29 12:34:56 +02:00
parent 1caf2aa0f6
commit c01576412a
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
15 changed files with 43 additions and 43 deletions

View file

@ -305,8 +305,8 @@ fn diff_update(self: *Self) !void {
return;
}
const editor = self.editor;
const new = if (editor.get_current_root()) |new| new else return;
const old = if (editor.buffer) |buffer| if (buffer.last_save) |old| old else return else return;
const new = editor.get_current_root() orelse return;
const old = if (editor.buffer) |buffer| buffer.last_save orelse return else return;
return self.diff.diff(diff_result, new, old);
}