Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Use final for generated variables that are not reassigned #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/src/class_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class ClassBuilder extends Builder {
String buildRead() {
var code = StringBuffer();
code.writeln('''
var numOfFields = reader.readByte();
var fields = <int, dynamic>{
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return ${cls.name}(
Expand Down