From d2316ee718f59a62a585490f22cc4e99b77750dd Mon Sep 17 00:00:00 2001 From: Qwerasd Date: Wed, 19 Nov 2025 14:58:47 -0700 Subject: [PATCH] perf: inline size.getOffset and intFromBase --- src/terminal/size.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/terminal/size.zig b/src/terminal/size.zig index 13ba636c3..0dedfcc14 100644 --- a/src/terminal/size.zig +++ b/src/terminal/size.zig @@ -123,7 +123,7 @@ pub const OffsetBuf = struct { /// Get the offset for a given type from some base pointer to the /// actual pointer to the type. -pub fn getOffset( +pub inline fn getOffset( comptime T: type, base: anytype, ptr: *const T, @@ -134,7 +134,7 @@ pub fn getOffset( return .{ .offset = @intCast(offset) }; } -fn intFromBase(base: anytype) usize { +inline fn intFromBase(base: anytype) usize { const T = @TypeOf(base); return switch (@typeInfo(T)) { .pointer => |v| switch (v.size) {