Skip to content

Commit 0ae89a4

Browse files
committed
more variable removal
1 parent a4978f2 commit 0ae89a4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

nuget/Sqlite_net.SourceGenerator/SQLiteFastColumnSetterGenerator.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,7 @@ static void Execute(
377377
sb.AppendLine($" \"{property.ColumnName}\",");
378378
sb.AppendLine($" (obj, stmt, index) => ");
379379
sb.AppendLine($" {{");
380-
sb.AppendLine($" var colType = SQLite3.ColumnType(stmt, index);");
381-
sb.AppendLine($" if (colType != SQLite3.ColType.Null)");
380+
sb.AppendLine($" if (SQLite3.ColumnType(stmt, index) != SQLite3.ColType.Null)");
382381
sb.AppendLine($" {{");
383382

384383
// Generate appropriate setter based on property type
@@ -486,8 +485,7 @@ static void GeneratePropertySetter(string typedObject, StringBuilder sb, Propert
486485

487486
case "Guid":
488487
case "System.Guid":
489-
sb.AppendLine($" var text = SQLite3.ColumnString(stmt, index);");
490-
sb.AppendLine($" {typedObject}.{property.PropertyName} = new Guid(text);");
488+
sb.AppendLine($" {typedObject}.{property.PropertyName} = new Guid(SQLite3.ColumnString(stmt, index));");
491489
break;
492490

493491
case "byte[]":
@@ -506,8 +504,7 @@ static void GeneratePropertySetter(string typedObject, StringBuilder sb, Propert
506504
sb.AppendLine ($" }}");
507505
}
508506
else {
509-
sb.AppendLine ($" var value = SQLite3.ColumnInt(stmt, index);");
510-
sb.AppendLine ($" {typedObject}.{property.PropertyName} = ({propertyType})value;");
507+
sb.AppendLine ($" {typedObject}.{property.PropertyName} = ({propertyType})SQLite3.ColumnInt(stmt, index);");
511508
}
512509
}
513510
else {

0 commit comments

Comments
 (0)