feat: remove guard condition

This commit is contained in:
dscyrescotti committed 2024-06-25 17:01:10 +07:00
1 parent e3183aa4b2
commit 32af33f617
3 files changed
-9

No files matched your search

@@ -174,9 +174,6 @@ extension GraphicContext {
extension GraphicContext: Drawable {
func prepare(device: MTLDevice) {
guard vertexBuffer == nil else {
return
}
vertexCount = vertices.count
vertexBuffer = device.makeBuffer(bytes: vertices, length: vertexCount * MemoryLayout<ViewPortVertex>.stride, options: [])
}
-3
View File
@@ -30,9 +30,6 @@ class GridContext {
extension GridContext: Drawable {
func prepare(device: MTLDevice) {
guard vertexBuffer == nil else {
return
}
vertexBuffer = device.makeBuffer(bytes: vertices, length: vertexCount * MemoryLayout<GridVertex>.stride, options: [])
}
@@ -36,9 +36,6 @@ class ViewPortContext {
extension ViewPortContext: Drawable {
func prepare(device: MTLDevice) {
guard vertexBuffer == nil else {
return
}
vertexBuffer = device.makeBuffer(bytes: vertices, length: vertexCount * MemoryLayout<ViewPortVertex>.stride, options: [])
}