aboutsummaryrefslogtreecommitdiff
path: root/std/endian.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-12-22 00:50:30 -0500
committerAndrew Kelley <superjoe30@gmail.com>2017-12-22 00:50:30 -0500
commitd917815d8111b98dc237cbe2c723fa63018e02b1 (patch)
treece12771a86b2412ee9692ca73d3ca49abe5da3ce /std/endian.zig
parent8bc523219c66427951e5339550502871547f2138 (diff)
downloadzig-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.zig6
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 {