diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-12-22 00:50:30 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-12-22 00:50:30 -0500 |
| commit | d917815d8111b98dc237cbe2c723fa63018e02b1 (patch) | |
| tree | ce12771a86b2412ee9692ca73d3ca49abe5da3ce /std/endian.zig | |
| parent | 8bc523219c66427951e5339550502871547f2138 (diff) | |
| download | zig-d917815d8111b98dc237cbe2c723fa63018e02b1.tar.gz zig-d917815d8111b98dc237cbe2c723fa63018e02b1.zip | |
explicitly return from blocks
instead of last statement being expression value
closes #629
Diffstat (limited to 'std/endian.zig')
| -rw-r--r-- | std/endian.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/std/endian.zig b/std/endian.zig index 2dc6b8d34e..9f2d2c8dcd 100644 --- a/std/endian.zig +++ b/std/endian.zig @@ -2,15 +2,15 @@ const mem = @import("mem.zig"); const builtin = @import("builtin"); pub fn swapIfLe(comptime T: type, x: T) -> T { - swapIf(false, T, x) + return swapIf(false, T, x); } pub fn swapIfBe(comptime T: type, x: T) -> T { - swapIf(true, T, x) + return swapIf(true, T, x); } pub fn swapIf(endian: builtin.Endian, comptime T: type, x: T) -> T { - if (builtin.endian == endian) swap(T, x) else x + return if (builtin.endian == endian) swap(T, x) else x; } pub fn swap(comptime T: type, x: T) -> T { |
