Skip to content

Commit 0a1ae2a

Browse files
authored
Remove @inline(__always) from _render functions (#75)
* Remove @inline(__always) * Clean up unnecessary whitespace left behind * More whitespace cleanup * Put back some inlines
1 parent 5e6a7b5 commit 0a1ae2a

File tree

9 files changed

+42
-44
lines changed

9 files changed

+42
-44
lines changed

Sources/Elementary/Core/AsyncContent.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public struct AsyncContent<Content: HTML>: HTML, Sendable {
2323
self.content = content
2424
}
2525

26-
@inlinable @inline(__always)
26+
@inlinable
2727
public static func _render<Renderer: _HTMLRendering>(
2828
_ html: consuming Self,
2929
into renderer: inout Renderer,
@@ -32,7 +32,7 @@ public struct AsyncContent<Content: HTML>: HTML, Sendable {
3232
context.assertionFailureNoAsyncContext(self)
3333
}
3434

35-
@inlinable @inline(__always)
35+
@inlinable
3636
public static func _render<Renderer: _AsyncHTMLRendering>(
3737
_ html: consuming Self,
3838
into renderer: inout Renderer,

Sources/Elementary/Core/AsyncForEach.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public struct AsyncForEach<Source: AsyncSequence, Content: HTML>: HTML {
2727
self.contentBuilder = contentBuilder
2828
}
2929

30-
@inlinable @inline(__always)
30+
@inlinable
3131
public static func _render<Renderer: _HTMLRendering>(
3232
_ html: consuming Self,
3333
into renderer: inout Renderer,
@@ -36,7 +36,7 @@ public struct AsyncForEach<Source: AsyncSequence, Content: HTML>: HTML {
3636
context.assertionFailureNoAsyncContext(self)
3737
}
3838

39-
@inlinable @inline(__always)
39+
@inlinable
4040
public static func _render<Renderer: _AsyncHTMLRendering>(
4141
_ html: consuming Self,
4242
into renderer: inout Renderer,

Sources/Elementary/Core/CoreModel.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public protocol _AsyncHTMLRendering {
8787
}
8888

8989
public extension HTML {
90-
@inlinable @inline(__always)
90+
@inlinable
9191
static func _render<Renderer: _HTMLRendering>(
9292
_ html: consuming Self,
9393
into renderer: inout Renderer,
@@ -96,7 +96,7 @@ public extension HTML {
9696
Content._render(html.content, into: &renderer, with: context)
9797
}
9898

99-
@inlinable @inline(__always)
99+
@inlinable
100100
static func _render<Renderer: _AsyncHTMLRendering>(
101101
_ html: consuming Self,
102102
into renderer: inout Renderer,
@@ -107,6 +107,6 @@ public extension HTML {
107107
}
108108

109109
public extension HTMLTagDefinition {
110-
@inlinable @inline(__always)
110+
@inlinable
111111
static var _rendersInline: Bool { false }
112112
}

Sources/Elementary/Core/Environment.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public struct _ModifiedTaskLocal<T: Sendable, Content: HTML>: HTML {
8181
var taskLocal: TaskLocal<T>
8282
var value: T
8383

84-
@inline(__always)
8584
public static func _render<Renderer: _HTMLRendering>(
8685
_ html: consuming Self,
8786
into renderer: inout Renderer,
@@ -97,7 +96,6 @@ public struct _ModifiedTaskLocal<T: Sendable, Content: HTML>: HTML {
9796
}
9897
}
9998

100-
@inline(__always)
10199
public static func _render<Renderer: _AsyncHTMLRendering>(
102100
_ html: consuming Self,
103101
into renderer: inout Renderer,

Sources/Elementary/Core/ForEach.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ where Data: Sequence, Content: HTML {
2626
_contentBuilder = contentBuilder
2727
}
2828

29-
@inlinable @inline(__always)
29+
@inlinable
3030
public static func _render<Renderer: _HTMLRendering>(
3131
_ html: consuming Self,
3232
into renderer: inout Renderer,
@@ -39,7 +39,7 @@ where Data: Sequence, Content: HTML {
3939
}
4040
}
4141

42-
@inlinable @inline(__always)
42+
@inlinable
4343
public static func _render<Renderer: _AsyncHTMLRendering>(
4444
_ html: consuming Self,
4545
into renderer: inout Renderer,

Sources/Elementary/Core/Html+Attributes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public struct _AttributedElement<Content: HTML>: HTML {
7373
self.attributes = attributes
7474
}
7575

76-
@inlinable @inline(__always)
76+
@inlinable
7777
public static func _render<Renderer: _HTMLRendering>(
7878
_ html: consuming Self,
7979
into renderer: inout Renderer,
@@ -83,7 +83,7 @@ public struct _AttributedElement<Content: HTML>: HTML {
8383
Content._render(html.content, into: &renderer, with: context)
8484
}
8585

86-
@inlinable @inline(__always)
86+
@inlinable
8787
public static func _render<Renderer: _AsyncHTMLRendering>(
8888
_ html: consuming Self,
8989
into renderer: inout Renderer,

Sources/Elementary/Core/Html+Elements.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public struct HTMLElement<Tag: HTMLTagDefinition, Content: HTML>: HTML where Tag
4545
self.content = content()
4646
}
4747

48-
@inlinable @inline(__always)
48+
@inlinable
4949
public static func _render<Renderer: _HTMLRendering>(
5050
_ html: consuming Self,
5151
into renderer: inout Renderer,
@@ -58,7 +58,7 @@ public struct HTMLElement<Tag: HTMLTagDefinition, Content: HTML>: HTML where Tag
5858
renderer.appendToken(.endTag(Tag.name, type: Tag.renderingType))
5959
}
6060

61-
@inlinable @inline(__always)
61+
@inlinable
6262
public static func _render<Renderer: _AsyncHTMLRendering>(
6363
_ html: consuming Self,
6464
into renderer: inout Renderer,
@@ -107,7 +107,7 @@ public struct HTMLVoidElement<Tag: HTMLTagDefinition>: HTML where Tag: HTMLTrait
107107
_attributes = .init(attributes)
108108
}
109109

110-
@inlinable @inline(__always)
110+
@inlinable
111111
public static func _render<Renderer: _HTMLRendering>(
112112
_ html: consuming Self,
113113
into renderer: inout Renderer,
@@ -117,7 +117,7 @@ public struct HTMLVoidElement<Tag: HTMLTagDefinition>: HTML where Tag: HTMLTrait
117117
renderer.appendToken(.startTag(Tag.name, attributes: html._attributes.flattened(), isUnpaired: true, type: Tag.renderingType))
118118
}
119119

120-
@inlinable @inline(__always)
120+
@inlinable
121121
public static func _render<Renderer: _AsyncHTMLRendering>(
122122
_ html: consuming Self,
123123
into renderer: inout Renderer,
@@ -142,7 +142,7 @@ public struct HTMLComment: HTML {
142142
self.text = text
143143
}
144144

145-
@inlinable @inline(__always)
145+
@inlinable
146146
public static func _render<Renderer: _HTMLRendering>(
147147
_ html: consuming Self,
148148
into renderer: inout Renderer,
@@ -152,7 +152,7 @@ public struct HTMLComment: HTML {
152152
renderer.appendToken(.comment(html.text))
153153
}
154154

155-
@inlinable @inline(__always)
155+
@inlinable
156156
public static func _render<Renderer: _AsyncHTMLRendering>(
157157
_ html: consuming Self,
158158
into renderer: inout Renderer,
@@ -175,7 +175,7 @@ public struct HTMLRaw: HTML {
175175
self.text = text
176176
}
177177

178-
@inlinable @inline(__always)
178+
@inlinable
179179
public static func _render<Renderer: _HTMLRendering>(
180180
_ html: consuming Self,
181181
into renderer: inout Renderer,
@@ -185,7 +185,7 @@ public struct HTMLRaw: HTML {
185185
renderer.appendToken(.raw(html.text))
186186
}
187187

188-
@inlinable @inline(__always)
188+
@inlinable
189189
public static func _render<Renderer: _AsyncHTMLRendering>(
190190
_ html: consuming Self,
191191
into renderer: inout Renderer,
@@ -202,7 +202,7 @@ extension HTMLComment: Sendable {}
202202
extension HTMLRaw: Sendable {}
203203

204204
extension HTMLTagDefinition {
205-
@usableFromInline @inline(__always)
205+
@usableFromInline
206206
static var renderingType: _HTMLRenderToken.RenderingType {
207207
_rendersInline ? .inline : .block
208208
}

Sources/Elementary/Core/HtmlBuilder+Tuples.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public struct _HTMLTuple2<V0: HTML, V1: HTML>: HTML {
6262
self.v1 = v1
6363
}
6464

65-
@inlinable @inline(__always)
65+
@inlinable
6666
public static func _render<Renderer: _HTMLRendering>(
6767
_ html: consuming Self,
6868
into renderer: inout Renderer,
@@ -74,7 +74,7 @@ public struct _HTMLTuple2<V0: HTML, V1: HTML>: HTML {
7474
V1._render(html.v1, into: &renderer, with: copy context)
7575
}
7676

77-
@inlinable @inline(__always)
77+
@inlinable
7878
public static func _render<Renderer: _AsyncHTMLRendering>(
7979
_ html: consuming Self,
8080
into renderer: inout Renderer,
@@ -100,7 +100,7 @@ public struct _HTMLTuple3<V0: HTML, V1: HTML, V2: HTML>: HTML {
100100
self.v2 = v2
101101
}
102102

103-
@inlinable @inline(__always)
103+
@inlinable
104104
public static func _render<Renderer: _HTMLRendering>(
105105
_ html: consuming Self,
106106
into renderer: inout Renderer,
@@ -113,7 +113,7 @@ public struct _HTMLTuple3<V0: HTML, V1: HTML, V2: HTML>: HTML {
113113
V2._render(html.v2, into: &renderer, with: copy context)
114114
}
115115

116-
@inlinable @inline(__always)
116+
@inlinable
117117
public static func _render<Renderer: _AsyncHTMLRendering>(
118118
_ html: consuming Self,
119119
into renderer: inout Renderer,
@@ -142,7 +142,7 @@ public struct _HTMLTuple4<V0: HTML, V1: HTML, V2: HTML, V3: HTML>: HTML {
142142
self.v3 = v3
143143
}
144144

145-
@inlinable @inline(__always)
145+
@inlinable
146146
public static func _render<Renderer: _HTMLRendering>(
147147
_ html: consuming Self,
148148
into renderer: inout Renderer,
@@ -156,7 +156,7 @@ public struct _HTMLTuple4<V0: HTML, V1: HTML, V2: HTML, V3: HTML>: HTML {
156156
V3._render(html.v3, into: &renderer, with: copy context)
157157
}
158158

159-
@inlinable @inline(__always)
159+
@inlinable
160160
public static func _render<Renderer: _AsyncHTMLRendering>(
161161
_ html: consuming Self,
162162
into renderer: inout Renderer,
@@ -188,7 +188,7 @@ public struct _HTMLTuple5<V0: HTML, V1: HTML, V2: HTML, V3: HTML, V4: HTML>: HTM
188188
self.v4 = v4
189189
}
190190

191-
@inlinable @inline(__always)
191+
@inlinable
192192
public static func _render<Renderer: _HTMLRendering>(
193193
_ html: consuming Self,
194194
into renderer: inout Renderer,
@@ -203,7 +203,7 @@ public struct _HTMLTuple5<V0: HTML, V1: HTML, V2: HTML, V3: HTML, V4: HTML>: HTM
203203
V4._render(html.v4, into: &renderer, with: copy context)
204204
}
205205

206-
@inlinable @inline(__always)
206+
@inlinable
207207
public static func _render<Renderer: _AsyncHTMLRendering>(
208208
_ html: consuming Self,
209209
into renderer: inout Renderer,
@@ -238,7 +238,7 @@ public struct _HTMLTuple6<V0: HTML, V1: HTML, V2: HTML, V3: HTML, V4: HTML, V5:
238238
self.v5 = v5
239239
}
240240

241-
@inlinable @inline(__always)
241+
@inlinable
242242
public static func _render<Renderer: _HTMLRendering>(
243243
_ html: consuming Self,
244244
into renderer: inout Renderer,
@@ -254,7 +254,7 @@ public struct _HTMLTuple6<V0: HTML, V1: HTML, V2: HTML, V3: HTML, V4: HTML, V5:
254254
V5._render(html.v5, into: &renderer, with: copy context)
255255
}
256256

257-
@inlinable @inline(__always)
257+
@inlinable
258258
public static func _render<Renderer: _AsyncHTMLRendering>(
259259
_ html: consuming Self,
260260
into renderer: inout Renderer,
@@ -283,7 +283,7 @@ public struct _HTMLTuple<each Child: HTML>: HTML {
283283
self.value = (repeat each value)
284284
}
285285

286-
@inlinable @inline(__always)
286+
@inlinable
287287
public static func _render<Renderer: _HTMLRendering>(
288288
_ html: consuming Self,
289289
into renderer: inout Renderer,
@@ -298,7 +298,7 @@ public struct _HTMLTuple<each Child: HTML>: HTML {
298298
repeat renderElement(each html.value, &renderer)
299299
}
300300

301-
@inlinable @inline(__always)
301+
@inlinable
302302
public static func _render<Renderer: _AsyncHTMLRendering>(
303303
_ html: consuming Self,
304304
into renderer: inout Renderer,

Sources/Elementary/Core/HtmlBuilder.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ extension Never: HTML {
6565
}
6666

6767
extension Optional: HTML where Wrapped: HTML {
68-
@inlinable @inline(__always)
68+
@inlinable
6969
public static func _render<Renderer: _HTMLRendering>(
7070
_ html: consuming Self,
7171
into renderer: inout Renderer,
@@ -77,7 +77,7 @@ extension Optional: HTML where Wrapped: HTML {
7777
}
7878
}
7979

80-
@inlinable @inline(__always)
80+
@inlinable
8181
public static func _render<Renderer: _AsyncHTMLRendering>(
8282
_ html: consuming Self,
8383
into renderer: inout Renderer,
@@ -94,7 +94,7 @@ extension Optional: HTML where Wrapped: HTML {
9494
public struct EmptyHTML: HTML, Sendable {
9595
public init() {}
9696

97-
@inlinable @inline(__always)
97+
@inlinable
9898
public static func _render<Renderer: _HTMLRendering>(
9999
_ html: consuming Self,
100100
into renderer: inout Renderer,
@@ -103,7 +103,7 @@ public struct EmptyHTML: HTML, Sendable {
103103
context.assertNoAttributes(self)
104104
}
105105

106-
@inlinable @inline(__always)
106+
@inlinable
107107
public static func _render<Renderer: _AsyncHTMLRendering>(
108108
_ html: consuming Self,
109109
into renderer: inout Renderer,
@@ -132,7 +132,7 @@ public struct HTMLText: HTML, Sendable {
132132
self.text = text
133133
}
134134

135-
@inlinable @inline(__always)
135+
@inlinable
136136
public static func _render<Renderer: _HTMLRendering>(
137137
_ html: consuming Self,
138138
into renderer: inout Renderer,
@@ -142,7 +142,7 @@ public struct HTMLText: HTML, Sendable {
142142
renderer.appendToken(.text(html.text))
143143
}
144144

145-
@inlinable @inline(__always)
145+
@inlinable
146146
public static func _render<Renderer: _AsyncHTMLRendering>(
147147
_ html: consuming Self,
148148
into renderer: inout Renderer,
@@ -169,7 +169,7 @@ public struct _HTMLConditional<TrueContent: HTML, FalseContent: HTML>: HTML {
169169
self.value = value
170170
}
171171

172-
@inlinable @inline(__always)
172+
@inlinable
173173
public static func _render<Renderer: _HTMLRendering>(
174174
_ html: consuming Self,
175175
into renderer: inout Renderer,
@@ -181,7 +181,7 @@ public struct _HTMLConditional<TrueContent: HTML, FalseContent: HTML>: HTML {
181181
}
182182
}
183183

184-
@inlinable @inline(__always)
184+
@inlinable
185185
public static func _render<Renderer: _AsyncHTMLRendering>(
186186
_ html: consuming Self,
187187
into renderer: inout Renderer,
@@ -208,7 +208,7 @@ public struct _HTMLArray<Element: HTML>: HTML {
208208
self.value = value
209209
}
210210

211-
@inlinable @inline(__always)
211+
@inlinable
212212
public static func _render<Renderer: _HTMLRendering>(
213213
_ html: consuming Self,
214214
into renderer: inout Renderer,
@@ -221,7 +221,7 @@ public struct _HTMLArray<Element: HTML>: HTML {
221221
}
222222
}
223223

224-
@inlinable @inline(__always)
224+
@inlinable
225225
public static func _render<Renderer: _AsyncHTMLRendering>(
226226
_ html: consuming Self,
227227
into renderer: inout Renderer,

0 commit comments

Comments
 (0)