From 2cc24320ad75038437c1caa31754d4b732a1cd78 Mon Sep 17 00:00:00 2001 From: Kenta Kubo <601636+kkebo@users.noreply.github.com> Date: Mon, 21 Oct 2024 01:48:52 +0900 Subject: [PATCH] refactor: refactor pointer access `subscript` is more convenient. --- Sources/Kernel/Framebuffer.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Kernel/Framebuffer.swift b/Sources/Kernel/Framebuffer.swift index c00bb03..fd149b2 100644 --- a/Sources/Kernel/Framebuffer.swift +++ b/Sources/Kernel/Framebuffer.swift @@ -96,7 +96,7 @@ struct Framebuffer: ~Copyable { @inlinable func drawPoint(x: Int, y: Int, color: UInt32) { - self.pointer.advanced(by: y * Int(self.width) + x).pointee = color + self.pointer[y * Int(self.width) + x] = color } func fillRect(x0: Int, y0: Int, x1: Int, y1: Int, color: UInt32) {