c80911d8
refactor: delete three decls nothing calls
a73x 2026-08-29 01:15
Commit message
src/client/keymap.zig
| Old | New | ||
|---|---|---|---|
| @@ -202,18 +202,6 @@ fn ss3Key(mods: Mods, final: u8, buf: []u8) []const u8 { | |||
| 202 | pub const paste_begin = "\x1b[200~"; | 202 | pub const paste_begin = "\x1b[200~"; |
| 203 | pub const paste_end = "\x1b[201~"; | 203 | pub const paste_end = "\x1b[201~"; |
| 204 | 204 | ||
| 205 | /// Bytes between the brackets go verbatim; filtering a pasted ESC is | ||
| 206 | /// policy. | ||
| 207 | pub fn pasteInto( | ||
| 208 | list: *std.ArrayList(u8), | ||
| 209 | alloc: std.mem.Allocator, | ||
| 210 | bytes: []const u8, | ||
| 211 | ) !void { | ||
| 212 | try list.appendSlice(alloc, paste_begin); | ||
| 213 | try list.appendSlice(alloc, bytes); | ||
| 214 | try list.appendSlice(alloc, paste_end); | ||
| 215 | } | ||
| 216 | |||
| 217 | // --------------------------------------------------------------------------- | 205 | // --------------------------------------------------------------------------- |
| 218 | 206 | ||
| 219 | test "keymap: the table" { | 207 | test "keymap: the table" { |
| @@ -325,14 +313,6 @@ test "keymap: the modifier matrix over every CSI-carrying key" { | |||
| 325 | } | 313 | } |
| 326 | } | 314 | } |
| 327 | 315 | ||
| 328 | test "keymap: bracketed paste wraps" { | ||
| 329 | const alloc = std.testing.allocator; | ||
| 330 | var out: std.ArrayList(u8) = .empty; | ||
| 331 | defer out.deinit(alloc); | ||
| 332 | try pasteInto(&out, alloc, "two\nlines"); | ||
| 333 | try std.testing.expectEqualStrings("\x1b[200~two\nlines\x1b[201~", out.items); | ||
| 334 | } | ||
| 335 | |||
| 336 | // Forces semantic analysis of every pub decl under `zig build test`, so an | 316 | // Forces semantic analysis of every pub decl under `zig build test`, so an |
| 337 | // unreferenced decl must at least compile (the silent-module-loss hazard, | 317 | // unreferenced decl must at least compile (the silent-module-loss hazard, |
| 338 | // decisions.md). Pub decls only: std.meta.declarations sees nothing private. | 318 | // decisions.md). Pub decls only: std.meta.declarations sees nothing private. |
src/engine/protocol.zig
| Old | New | ||
|---|---|---|---|
| @@ -218,14 +218,6 @@ pub fn decodeSize(payload: []const u8) !Size { | |||
| 218 | pub const min_session_cols = 2; | 218 | pub const min_session_cols = 2; |
| 219 | pub const min_session_rows = 2; | 219 | pub const min_session_rows = 2; |
| 220 | 220 | ||
| 221 | pub fn putU32(buf: *[4]u8, v: u32) void { | ||
| 222 | std.mem.writeInt(u32, buf, v, .little); | ||
| 223 | } | ||
| 224 | |||
| 225 | pub fn getU32(buf: *const [4]u8) u32 { | ||
| 226 | return std.mem.readInt(u32, buf, .little); | ||
| 227 | } | ||
| 228 | |||
| 229 | pub const ScrollbackReq = struct { start: u32, count: u16 }; | 221 | pub const ScrollbackReq = struct { start: u32, count: u16 }; |
| 230 | 222 | ||
| 231 | pub fn encodeScrollbackReq(start: u32, count: u16) [6]u8 { | 223 | pub fn encodeScrollbackReq(start: u32, count: u16) [6]u8 { |
| @@ -1211,12 +1203,6 @@ test "appendFrame concatenates frames the way a queue would" { | |||
| 1211 | try std.testing.expectEqualSlices(u8, &.{7}, f2.payload); | 1203 | try std.testing.expectEqualSlices(u8, &.{7}, f2.payload); |
| 1212 | } | 1204 | } |
| 1213 | 1205 | ||
| 1214 | test "u32 encode/decode round trip" { | ||
| 1215 | var buf: [4]u8 = undefined; | ||
| 1216 | putU32(&buf, 123456789); | ||
| 1217 | try std.testing.expectEqual(@as(u32, 123456789), getU32(buf[0..4])); | ||
| 1218 | } | ||
| 1219 | |||
| 1220 | test "scrollback request encode/decode round trip" { | 1206 | test "scrollback request encode/decode round trip" { |
| 1221 | const req = try decodeScrollbackReq(&encodeScrollbackReq(70000, 24)); | 1207 | const req = try decodeScrollbackReq(&encodeScrollbackReq(70000, 24)); |
| 1222 | try std.testing.expectEqual(@as(u32, 70000), req.start); | 1208 | try std.testing.expectEqual(@as(u32, 70000), req.start); |
src/server/quic_server.zig
| Old | New | ||
|---|---|---|---|
| @@ -485,13 +485,6 @@ pub const Listener = struct { | |||
| 485 | return cn.out.held; | 485 | return cn.out.held; |
| 486 | } | 486 | } |
| 487 | 487 | ||
| 488 | /// Push a connection's egress with no event to hang it off: draining | ||
| 489 | /// out, or after acks free room. | ||
| 490 | pub fn kick(self: *Listener, id: u64) void { | ||
| 491 | const cn = self.find(id) orelse return; | ||
| 492 | self.drain(cn); | ||
| 493 | } | ||
| 494 | |||
| 495 | /// Close ONE connection and nothing else — never the socket it shares. | 488 | /// Close ONE connection and nothing else — never the socket it shares. |
| 496 | /// Every QUIC peer is multiplexed over one UDP socket, so closing "the | 489 | /// Every QUIC peer is multiplexed over one UDP socket, so closing "the |
| 497 | /// client's transport" would take down every other session. | 490 | /// client's transport" would take down every other session. |