Skip to content

Commit 8cd2b09

Browse files
committed
Cleanup
1 parent 54cb451 commit 8cd2b09

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

src/Carbon.Css/Ast/CssDeclaration.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ public override string ToString()
6464
var sb = new ValueStringBuilder(stackalloc char[64]);
6565

6666
sb.Append(Info.Name);
67-
6867
sb.Append(": ");
69-
7068
Value.WriteTo(ref sb);
7169

7270
if (Priority is not null)

src/Carbon.Css/Ast/Selectors/Selector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ internal void WriteTo(ref ValueStringBuilder sb)
6161
if (Arguments != null)
6262
{
6363
sb.Append('(');
64-
sb.Append(Arguments.ToString());
64+
Arguments.WriteTo(ref sb);
6565
sb.Append(')');
6666
}
6767

src/Carbon.Css/Ast/Selectors/SelectorList.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static SelectorList Parse(string text)
1515

1616
public override string ToString()
1717
{
18-
var sb = new ValueStringBuilder();
18+
var sb = new ValueStringBuilder(128);
1919

2020
for (int i = 0; i < Count; i++)
2121
{

src/Carbon.Css/Model/TokenList.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public override string ToString()
2626
}
2727
}
2828

29-
private void WriteTo(ref ValueStringBuilder writer)
29+
private void WriteTo(scoped ref ValueStringBuilder writer)
3030
{
3131
var span = CollectionsMarshal.AsSpan(this);
3232

src/Carbon.Css/StyleSheet.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,16 @@ private void ImportInline(ImportRule rule)
201201
catch (SyntaxException ex)
202202
{
203203
AddChild(new StyleRule("body, html") {
204-
new CssDeclaration("background-color", "red", "important")
205-
});
204+
new CssDeclaration("background-color", "red", "important")
205+
});
206206

207207
AddChild(new StyleRule("body *") {
208-
{ "display", "none" }
209-
});
208+
{ "display", "none" }
209+
});
210210

211211
AddChild(new CssComment($" --- Syntax error reading '{absolutePath}' : {ex.Message} --- "));
212212

213-
214-
if (ex.Lines is { Count: > 0})
213+
if (ex.Lines is { Count: > 0})
215214
{
216215
var sb = new ValueStringBuilder(512);
217216

0 commit comments

Comments
 (0)